Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save arackaf/bddd3849b1e2a16e556bf5b4b7056c83 to your computer and use it in GitHub Desktop.
import allSubjects from "../graphQL/subjects/allSubjects.graphql";
workbox.routing.registerRoute(
/graphql/,
({ url, event }) => {
return fetch(event.request).catch(err => {
let { query, variables } = parseQueryString(url.search);
if (query == allSubjects) {
return readTable("subjects", "name").then(gqlResponse("allSubjects", "Subjects"));
}
});
},
"GET"
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment