Creating a Strapi Dynamic Zone & Rendering it in your Nuxt.js App

I followed this guide and got a " Cannot read property ‘types’ of undefined" error from apollo.

By the way you’ve written the apollo config, you’re using apollo-client version 2 (according to this: Fragment Matcher | GraphQL Code Generator). That requires specifying the apolloClientVersion in codegen.yml.

After changing it to look like this:

schema: "http://127.0.0.1:1337/graphql"
generates:
  ./fragmentTypes.json:
    plugins:
      - "fragment-matcher"
    config:
      apolloClientVersion: 2

everything works!

Thanks for the guide! It was really helpful to have everything explained all in one place.

2 Likes