Skip to content

Instantly share code, notes, and snippets.

@arackaf
Last active January 20, 2019 01:28
Show Gist options
  • Select an option

  • Save arackaf/c52012c9a534657c97e0bc1fe1b7695f to your computer and use it in GitHub Desktop.

Select an option

Save arackaf/c52012c9a534657c97e0bc1fe1b7695f to your computer and use it in GitHub Desktop.
workbox.routing.registerRoute(
/graphql$/,
({ url, event }) => {
let request = event.request.clone();
return fetch(event.request).then(response => {
let respClone = response.clone();
respClone.json().then(response => {
syncResultsFor({ request, response }, "Book", bookSyncTransform);
syncResultsFor({ request, response }, "Tag");
});
return response;
});
},
"POST"
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment