Guest User

Untitled

a guest
Jan 20th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. import allSubjects from "../graphQL/subjects/allSubjects.graphql";
  2.  
  3. workbox.routing.registerRoute(
  4. /graphql/,
  5. ({ url, event }) => {
  6. return fetch(event.request).catch(err => {
  7. let { query, variables } = parseQueryString(url.search);
  8.  
  9. if (query == allSubjects) {
  10. return readTable("subjects", "name").then(gqlResponse("allSubjects", "Subjects"));
  11. }
  12. });
  13. },
  14. "GET"
  15. );
Add Comment
Please, Sign In to add comment