<template>
  <div>
    <h3>Pages</h3>
    <ul>
      <li>
        <router-link to="/book">Book</router-link>
      </li>
      <li>
        <router-link to="/book/topic">Topic</router-link>
      </li>
      <li>
        <router-link to="/module">Modul</router-link>
      </li>
      <li>
        <router-link to="/rooms">Räume</router-link>
      </li>
    </ul>
  </div>
</template>

<script>
  import ALL_MODULES from '@/graphql/gql/queries/allModules.gql';

  export default {
    data() {
      return {
        modules: []
      };
    },

    apollo: {
      modules: {
        query: ALL_MODULES,
        // prefetch: true,
        manual: true,
        result({data, loading, networkStatus}) {
          if (!loading) {
            this.modules = this.$getRidOfEdges(data).modules;
          }
        }
      }
    }
  };
</script>
