How to Build a blog using Strapi, Nuxt (Vue) and Apollo

For anyone who can’t get the categories page to work, it’s because the GQL query in the walk-through is wrong. Change it to:

    query Categories($id: ID!){
      category(id: $id) {
        data {
          id
          attributes {
            name
            articles {
              data {
                id
                attributes {
                  title
                  content
                  image {
                    data {
                      attributes {
                        url
                      }
                    }
                  }
                  category {
                    data {
                      id
                      attributes {
                        name
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
1 Like