api-platform / api-platform/core

Entity inheritance to GraphQL interface

Aperta
#6,117 3 commenti 8 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
PHP
Stelle
2.6k
Fork
980
Merge medio
2g 2h
PR unite (30g)
51

Descrizione

I like the approach of GraphQLite: if Cat and Dog both inherit from some Animal class (stored in the database using either single table inheritance or class table inheritance), then the GraphQL schema generated will have an AnimalInterface which is then implemented by Cat and Dog. This allows one to perform queries like:

```
animals {
id
... on Cat {
someCatSpecificField
}
... on Dog {
someDogSpecificField
}
}
```

to fetch all Animals along with their implementation-specific fields. Unless I'm missing something, this is not possible with API Platform? My application makes use of inheritance a lot so annoyingly it's pretty much just this issue that is ruling out API Platform.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.