markhuot / craftql

A drop-in GraphQL server for Craft CMS
Other
319 stars 53 forks source link

Dropdown Optgroup causes an issue with CraftQL querying #332

Open simeon-smith opened 4 years ago

simeon-smith commented 4 years ago

Opened an issue with Super Table as well.

https://github.com/verbb/super-table/issues/349

Description

When you have a field that follows this structure:

Matrix Block > Super Table > Dropdown

Or with this structure:

Super Table > Dropdown

And you have an Optgroup in the dropdown it doesn't generate the correct GraphQL Schema for CraftQL. It appears to work fine for native GraphQL.

Steps to reproduce

  1. Make sure you have CraftQL.
  2. Create a Super Table field.
  3. Give it a Dropdown subfield
  4. Check optgroup for one of the options.
  5. Assign the field to a section.
  6. Go to the CraftQL explorer by clicking on CraftQL on the left menu.
  7. Search for the field handle.
  8. It should not show up.
  9. If you add another field to the Super Table field it should then show up with that other field as an option but not the Dropdown.
  10. If you remove the optgroup then it will show up.

Additional info

odelonmiranda commented 4 years ago

Experiencing the same issue, hope there will be a solution soon.

brynldrn commented 4 years ago

Also experiencing the same issue. Two scenarios actually:

  1. Matrix > Super Table > Dropdown
  2. Matrix (20+ blocks) > Dropdown

Hoping to have a solution soon.