This add-on aims to bring GraphQL support to OpenHAB.
After deployment, the system will respond with GraphQL playgrounds on /graphql, and accept queries and subscription requests at that URI.
Contributions welcome! I expect that I will try and eventually submit this as an addon to live in the openhab-addons project, but it needs some more work before then.
Please don’t rely on the shape of this API yet - there may be changes to come (esp. based on feedback)
There is a simple react project that you can use as a basis for your own experiments here:
- Querying mostly works for items and things. There are a few fields that are still nulled out (mostly around Commands and State) which will come soon.
- First mutation for sendCommand to an individual item.
- You can subscribe at an item, items (with a filter) or to everything within a group.
NB: This is working, but there seems to be an issue with playgrounds not being able to subscribe correctly.
- Lots of updates - filtering in items, optional querying through groups. First mutation (SendCommand). State now returned. Event subscriptions can also be to filters or to groups.
- initial work in progress