Skip to content

Important information is missing on the schema-customization page #38243

Open
@fgroenendijk

Description

Preliminary Checks

Summary

I am using a strapi plugin with complex types like Image and Dynamic zones. Sometimes a field did not have a value on any type and this would crash gatsby with an error.

The error I got was:

ERROR #85923 GRAPHQL.VALIDATION
There was an error in your GraphQL query:
Cannot query field "image" on type "STRAPI_ARTICLE".

To prevent this I wanted to use typedefs, but did not know how to correctly the types.
Until I stumbled upon actions.printTypeDefinitions.
This makes this process a lot easier when some fields are optional but initially not filled in.

The page I searched was: https://www.gatsbyjs.com/docs/reference/graphql-data-layer/schema-customization/

Steps to Resolve this Issue

  1. Please add some reference to actions.printTypeDefinitions in that page with an explanation that it can be used to infer types.
  2. And that to be able to use this correctly you would have to fill in every field once for the schema to be used in const typedefs.

Metadata

Assignees

No one assigned

    Labels

    status: triage neededIssue or pull request that need to be triaged and assigned to a reviewertype: documentationAn issue or pull request for improving or updating Gatsby's documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions