Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Dyanmic zone not returned as JSON in production #252

Closed
richard-grosjean opened this issue Oct 7, 2021 · 4 comments
Closed

Dyanmic zone not returned as JSON in production #252

richard-grosjean opened this issue Oct 7, 2021 · 4 comments

Comments

@richard-grosjean
Copy link

Using a dynamic zone in development (gatsby develop) works as expected, the dynamic zone field is returned as JSON.

But if I run gatsby clean and then gatsby build, an error is thrown.

The same external API is used in both cases, and the same error occurs when trying to deploy to Netlify.

 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Field "content" of type "[StrapiPageContent]" must have a selection of subfields. Did you mean "content { ... }"?

  1 | query cReposcompanyGatsbysrcpagesindexJs2512124318 {
  2 |   strapiPage(slug: {eq: "home"}) {
  3 |     id
  4 |     slug
  5 |     title
> 6 |     content
    |     ^
  7 |   }
  8 | }
  9 |

File path: C:/repos/company-gatsby/src/pages/index.js
Plugin: none

This is what the cached schema looks like:

type StrapiPage implements Node @dontInfer {
  content: JSON
  title: String
  order: Int
  slug: String
  published_at: Date @dateformat
  created_at: Date @dateformat
  updated_at: Date @dateformat
  strapiId: Int
}

Granted, I am running the Gatsby v4 beta, as the older version (much like strapi) will be losing support soon after v4 goes live.

@AntonKL
Copy link

AntonKL commented Nov 10, 2021

+1, facing the exact same problem.

@chakerben
Copy link

+1, facing the exact same problem.

@chakerben
Copy link

I solved this issue by using gatsby 4.3.0-next.1

@marceligrabowski
Copy link

Hello,
Please take a look at my response in #256.

It should cover your problem @richard-grosjean :)

Cheers,
Marceli

@soupette soupette mentioned this issue Feb 11, 2022
11 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants