verbb / vizy

A flexible visual editor for Craft CMS
Other
43 stars 8 forks source link

Unknown GraphQL Types #214

Open zollf opened 1 year ago

zollf commented 1 year ago

Describe the bug

When dumping GraphQL schema or looking at GraphiQL there are missing types. Execution of the query works correctly but the types are missing from the schema. Our current setup is using CraftCMS 3.8 headless and we generate Typescript typings from GraphQL schema, this errors as it is looking for types in the schema for VizyNodes such as VizyNode_Heading, VizyNode_Paragraph etc. Expected outcome is for these nodes to be in the schema.

Additionally, searching for these types in GraphiQL cannot be found. I believe it is because of this commit https://github.com/verbb/vizy/commit/776ea5c48a4b9d84b4ac909391ceefe409fabab2 since when generating the schema we don't have a field object and it skips all nodes. Removing this commit, everything works as intended.

Steps to reproduce

  1. Create a Vizy Field with Kitchen Sink configuration
  2. Add the new Vizy Field to a section so you can interact with it, this allows for GraphQL to pick up the Vizy Types
  3. Run ./craft graphql/dump-schema --full-schema
  4. VizyNodes such as VizyNode_Heading and VizyNode_Paragraphare missing

Craft CMS version

3.8.7

Plugin version

1.0.22

Multi-site?

No

Additional context

Vizy Field setup image

GraphQL with type missing image

engram-design commented 1 year ago

I'll note this is fixed in Vizy 2.x for Craft 4, and I'll see what's involved in back-tracking this to Vizy 1.x / Craft 3.