Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Graphiql explorer doesn't expand certain fieldtypes inside Bard set #5226

Open
dmgawel opened this issue Feb 8, 2022 · 2 comments
Open

Graphiql explorer doesn't expand certain fieldtypes inside Bard set #5226

dmgawel opened this issue Feb 8, 2022 · 2 comments

Comments

@dmgawel
Copy link
Contributor

dmgawel commented Feb 8, 2022

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
@christie-hill-za
Copy link

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
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants