BatchHttpLink with persisted queries

In the documentation it says that to use persisted queries with BatchHttpLink you have to put stuff in context and somehow store an id.

Does anybody have an example of this?

Thanks!