{"action":"closed","issue":{"url":"https://api.github.com/repos/nuxt-community/apollo-module/issues/69","repository_url":"https://api.github.com/repos/nuxt-community/apollo-module","labels_url":"https://api.github.com/repos/nuxt-community/apollo-module/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/nuxt-community/apollo-module/issues/69/comments","events_url":"https://api.github.com/repos/nuxt-community/apollo-module/issues/69/events","html_url":"https://github.com/nuxt-community/apollo-module/issues/69","id":289822521,"number":69,"title":"Nuxt generate support for dyamic routes?","user":{"login":"stromi","id":2929408,"avatar_url":"https://avatars3.githubusercontent.com/u/2929408?v=4","gravatar_id":"","url":"https://api.github.com/users/stromi","html_url":"https://github.com/stromi","followers_url":"https://api.github.com/users/stromi/followers","following_url":"https://api.github.com/users/stromi/following{/other_user}","gists_url":"https://api.github.com/users/stromi/gists{/gist_id}","starred_url":"https://api.github.com/users/stromi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stromi/subscriptions","organizations_url":"https://api.github.com/users/stromi/orgs","repos_url":"https://api.github.com/users/stromi/repos","events_url":"https://api.github.com/users/stromi/events{/privacy}","received_events_url":"https://api.github.com/users/stromi/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-01-19T00:21:46Z","updated_at":"2018-03-05T02:04:32Z","closed_at":"2018-03-05T02:04:32Z","author_association":"NONE","body":"Hi there, this might be a bit project-specific, but is it possible to get **nuxt.js** working with this **apollo** module in terms of dynamic routes generation?\r\n\r\nExample (small part of my app – the main question is at the end, but the intro may be useful to read, too, thanks in advance):\r\n\r\nI have an app, listing some shops that I get from an API (obviously...) and I list them in `pages/shops/index.vue` via the following:\r\n\r\n**index.vue** content: (`apollo` part only):\r\n```\r\napollo: {\r\n    allShops: {\r\n      prefetch: true,\r\n      query: allShops,\r\n      update (data) {\r\n        return data.site.shops.by_category.edges        \r\n\r\n      },\r\n      variables () {\r\n        return {\r\n          language: this.$store.state.language,\r\n          category: this.category\r\n        }\r\n      },\r\n      skip () {\r\n        return !this.$store.state.language\r\n      }\r\n    }\r\n  }\r\n```\r\n\r\n**allShops.gql** content:\r\n```query Shops($language: language, $category: ShopCategoryParam) {\r\n  site(language: $language) {    \r\n    shops { \r\n      by_category(category: $category, pagination: {sort: {field: name}, limit: 100}) {\r\n        total\r\n        edges {\r\n          node {\r\n            id\r\n            slug\r\n            name \r\n            latitude\r\n            longitude\r\n            opening_html\r\n          }\r\n        }\r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\n\r\nThis list works perfectly, I can filter, search, etc etc, but this is not the main point :)\r\n\r\n**shops/_slug.vue** content for a single shop (the **apollo** part only):\r\n```\r\napollo: {\r\n    Shop: {\r\n      query: shop,\r\n      update (data) {\r\n        return data.site.shops.by_slug\r\n      },\r\n      prefetch: ({ route }) => ({ slug: route.params.slug }),\r\n      variables() {\r\n        return { slug: this.$route.params.slug }\r\n      }\r\n    }\r\n  }\r\n```\r\n**shop.gql** content for a single shop, by slug:\r\n```\r\nquery Shop($slug: String!) {\r\n  site {\r\n    shops {\r\n      by_slug(slug: $slug) {\r\n        id\r\n        slug\r\n        name\r\n        latitude\r\n        longitude            \r\n      }\r\n    }\r\n  }\r\n}\r\n```\r\nThese stuff work like a charm, the app is fast, with smooth transitions and fast load times, (thumbs up, @Atinux, @alexchopin and @Akryum – and of course, the whole team).\r\n\r\n**BUT HOW DO I GENERATE ALL THES SHOPS' DYNAMIC ROUTES WITH NUXT.JS?**\r\nI actually have no idea (this is my fault, I am still learning GraphQL... So if **anyone** has any idea how to generate **all** the shops' routes like `/shops/shop-slug.html`, please help :) \r\n\r\nAll comments are appreaciated, and maybe this is just an issue because of my lack of knowledge on promises, payload or whatever this requires :) \r\n\r\nThnak you!\r\n\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"dohomi"}}