chore: Enhance schema with DeviceConfig tags resolver and update IntelliJ workspace adjustments

This commit is contained in:
Andreas Hilbig 2026-01-16 20:37:49 +01:00
parent 0c1f585909
commit c1035cd614
2 changed files with 16 additions and 9 deletions

24
.idea/workspace.xml generated
View file

@ -4,13 +4,8 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="d7a71994-2699-4ae4-9fd2-ee13b7f33d35" name="Changes" comment="chore: Update Dockerfile CMD for schema path, log schema loading path in `schema.ts`, and adjust IntelliJ workspace"> <list default="true" id="d7a71994-2699-4ae4-9fd2-ee13b7f33d35" name="Changes" comment="chore: Update `tags` field schema to use `DeviceConfig`, enhance `isDevice` type check, and adjust IntelliJ workspace">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/schema/devices.graphql" beforeDir="false" afterPath="$PROJECT_DIR$/schema/devices.graphql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/schema/extensions/display_devices.graphql" beforeDir="false" afterPath="$PROJECT_DIR$/schema/extensions/display_devices.graphql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/schema/extensions/location_tracker_devices.graphql" beforeDir="false" afterPath="$PROJECT_DIR$/schema/extensions/location_tracker_devices.graphql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/schema/zabbix.graphql" beforeDir="false" afterPath="$PROJECT_DIR$/schema/zabbix.graphql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/api/resolver_helpers.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/api/resolver_helpers.ts" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -157,7 +152,7 @@
<updated>1768273021451</updated> <updated>1768273021451</updated>
<workItem from="1768273025985" duration="11343000" /> <workItem from="1768273025985" duration="11343000" />
<workItem from="1768380302361" duration="9751000" /> <workItem from="1768380302361" duration="9751000" />
<workItem from="1768551040782" duration="4856000" /> <workItem from="1768551040782" duration="5628000" />
</task> </task>
<task id="LOCAL-00001" summary="chore: Update IntelliJ workspace settings and add GitHub Actions workflow for Docker deployment"> <task id="LOCAL-00001" summary="chore: Update IntelliJ workspace settings and add GitHub Actions workflow for Docker deployment">
<option name="closed" value="true" /> <option name="closed" value="true" />
@ -255,7 +250,15 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1768396879810</updated> <updated>1768396879810</updated>
</task> </task>
<option name="localTasksCounter" value="13" /> <task id="LOCAL-00013" summary="chore: Update `tags` field schema to use `DeviceConfig`, enhance `isDevice` type check, and adjust IntelliJ workspace">
<option name="closed" value="true" />
<created>1768591454965</created>
<option name="number" value="00013" />
<option name="presentableId" value="LOCAL-00013" />
<option name="project" value="LOCAL" />
<updated>1768591454965</updated>
</task>
<option name="localTasksCounter" value="14" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@ -285,6 +288,9 @@
<MESSAGE value="chore: Move schema directory away from src; Migrate `extensions` to `schema` directory, update Dockerfile and configuration paths" /> <MESSAGE value="chore: Move schema directory away from src; Migrate `extensions` to `schema` directory, update Dockerfile and configuration paths" />
<MESSAGE value="chore: Add `copy-schema` script, update Dockerfile schema path, and adjust npm prod workflow" /> <MESSAGE value="chore: Add `copy-schema` script, update Dockerfile schema path, and adjust npm prod workflow" />
<MESSAGE value="chore: Update Dockerfile CMD for schema path, log schema loading path in `schema.ts`, and adjust IntelliJ workspace" /> <MESSAGE value="chore: Update Dockerfile CMD for schema path, log schema loading path in `schema.ts`, and adjust IntelliJ workspace" />
<option name="LAST_COMMIT_MESSAGE" value="chore: Update Dockerfile CMD for schema path, log schema loading path in `schema.ts`, and adjust IntelliJ workspace" /> <MESSAGE value="chore: Use DeviceConfig type instead of JSONObject scalar for tags - attribute of devices" />
<MESSAGE value="chore: Use DeviceConfig type instead of JSONObject scalar for tags - attribute of devices " />
<MESSAGE value="chore: Update `tags` field schema to use `DeviceConfig`, enhance `isDevice` type check, and adjust IntelliJ workspace" />
<option name="LAST_COMMIT_MESSAGE" value="chore: Update `tags` field schema to use `DeviceConfig`, enhance `isDevice` type check, and adjust IntelliJ workspace" />
</component> </component>
</project> </project>

View file

@ -52,6 +52,7 @@ export async function schema_loader(): Promise<GraphQLSchema> {
let genericResolvers: Record<string, any> = { let genericResolvers: Record<string, any> = {
Device: createZabbixHierarchicalDeviceFieldResolver("Device", originalSchema,additionalMappings ), Device: createZabbixHierarchicalDeviceFieldResolver("Device", originalSchema,additionalMappings ),
GenericDevice: createZabbixHierarchicalDeviceFieldResolver("GenericDevice", originalSchema, additionalMappings), GenericDevice: createZabbixHierarchicalDeviceFieldResolver("GenericDevice", originalSchema, additionalMappings),
DeviceConfig: createZabbixHierarchicalDeviceTagsResolver("DeviceConfig", originalSchema),
} }
if (process.env.ADDITIONAL_RESOLVERS) { if (process.env.ADDITIONAL_RESOLVERS) {
for (const resolver of process.env.ADDITIONAL_RESOLVERS.split(",")){ for (const resolver of process.env.ADDITIONAL_RESOLVERS.split(",")){