cms icon indicating copy to clipboard operation
cms copied to clipboard

Graphiql explorer doesn't expand certain fieldtypes inside Bard set

Open dmgawel opened this issue 3 years ago • 3 comments

Bug description

When certain fieldtypes (list below) are used for sets in a Bard field, Graphiql Explorer can't expand those sets in query builder. Clicking on set name inserts set name in a query, but neither checkbox is selected nor the field names in the set are presented. Zrzut ekranu 2022-02-8 o 13 23 33

How to reproduce

  1. Create a Bard field
  2. Add a set with one of the affected fieldtypes (e.g. Select, full list below)
  3. Enter Graphiql Explorer
  4. Try to compose a query for the Bard field based on a set created in step 2. Clicking on it does

Logs

No response

Versions

Statamic 3.2.32 Pro Laravel 8.82.0 PHP 8.0.15 No addons installed

Installation

Fresh statamic/statamic site via CLI

Additional details

List of fieldtypes affected by this issue:

  • Button Group
  • Checkboxes
  • Radio
  • Select
  • Assets
  • Collections
  • Entries
  • Form
  • Taxonomies
  • Terms
  • User Groups
  • Roles
  • Users
  • Grid
  • Replicator
  • Table
  • Taggable

dmgawel avatar Feb 08 '22 12:02 dmgawel

I am having a similar issue. I am trying to add an Asset field to a blog post's Bard field and in GraphiQL Explorer I can never select any sets other than the Video set I created. I haven't tested with other field types besides Assets and Text. The only field type that seems to work for me is Video.

"Set_Content_Embed" doesn't exist in the blueprint and whenever I add new sets to the bard field, they do not appear after a refresh (I also cleared the application cache) in the GraphiQL explorer. Even after I remove the Video embed set from the Bard field and I refresh the GraphiQL Explorer, the removed video field persists.

Ive attached some screenshots here.

Screenshot-2023-04-04-at-09-45-31-Test-post-‹-Blogs-‹-Collections-‹-Statamic Screenshot 2023-04-04 at 09-47-51 GraphiQL ‹ Statamic Screenshot-2023-04-04-at-09-50-59-GraphiQL-‹-Statamic

christie-hill-za avatar Apr 04 '23 08:04 christie-hill-za

I played around a bit and it seems the issue for me is when my Bard field has the handle content. I renamed it, along with updating its handle to blog_content and then it seems to work. I suspect it has to do with "reserved" handles in Statamic. I tried adding a set with a Text field and named it "Text" (handle was text), which broke, because Bard already references that handle when it sees a paragraph or some other text.

When I named it "Text Embed" and changed the handle to text_embed, it worked as expected.

I also tried to replicate with the Select field type according to the original poster and it seems to work fine with Statamic 3.4.7

I assume this issue could be because of the handles used in sets within Bard. I changed them so that they're hopefully different to Bard's internal handles and things seemed to work fine then.

Hope this helps!

christie-hill-za avatar Apr 04 '23 09:04 christie-hill-za

Is this still an issue on the latest Statamic version? I'm struggling to replicate it.

ryanmitchell avatar May 12 '25 10:05 ryanmitchell

I'm unable to reproduce this issue on the latest version of Statamic.

I'm going to close this issue now. If you're still experiencing this issue, please leave a comment and we can re-open the issue. Thanks!

duncanmcclean avatar Jun 19 '25 09:06 duncanmcclean