GraphQL schema for multiple collections with Bard+Sets is invalid

Aperta
#5,211 6 commenti 5 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
graphql, php
Ambito
api

Direzione di ricerca

Start by reproducing the issue in GraphiQL with two collections that have different sets on their Bard content fields, then inspect the generated schema for Entry_Aaa_Aaa and Entry_Bbb_Bbb. The issue does not name implementation files or tests, so trace where collection-specific Bard sets enter schema generation. Done when each collection's content field uses its own sets and the schema is valid.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bard graphql
Bug description

When there is more than one collection that has a Bard field with Sets, the generated GraphQL schema is invalid. List of possible Sets from one of the Bard fields is used for all other collections.

How to reproduce
  1. Create two collections, "aaa" and "bbb".
  2. Add a Bard field named content to both of them.
  3. Add different sets to the content field for both collections and add sample fields (can be text type) inside sets
  4. Visit GraphiQL Explorer and try to fetch entries including content field on both Entry_Aaa_Aaa and Entry_Bbb_Bbb. You'll see that sets for Entry_Bbb_Bbb are used for Entry_Aaa_Aaa as well (could be the other way, I'm not sure what the rule is here, but looks like it's alphabetical).
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

No response

Lingua principale
PHP
Stelle
4.9k
Fork
647
Merge medio
1g 45m
PR unite (30g)
221

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di statamic/cms

Tutte le issue di statamic/cms

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.