api-platform automatically issues events to a mercure hub when updating resources marked with mercure=true
and publishes the topics to listen on in the according GET
endpoints. Nice. Is there already an option that I can use in the generated GraphQL endpoints?
The mercure docs say: https://github.com/dunglas/mercure#how-to-use-mercure-with-graphql that mercure should integrate "very well" with any GraphQL API as long as it "returns a corresponding topic URL". But afaik the GraphQL API generated by api-platform doesn't (https://api-platform.com/docs/core/mercure/). Do I miss anything or is this upcoming? Using apollo-vue on the frontend.
To work around I could listen to changes on all entity ids using dedicated EventSource
topics on the frontend. I would use an URI template like http://localhost:8080/product_streams/{id}
there. But I can't manage to write an uri template that matches only certain ids like: http://localhost:8080/product_streams/{id:123,456,789}
to get only updates for streams no 123 456 789 (tried https://uri-template-tester.mercure.rocks/ && https://www.rfc-editor.org/rfc/rfc6570#page-18) with no success :(