graphql-python / graphql-python/graphql-core-legacy

`schema_printer._print_object` should return interfaces joined with '&' instead of ','

Offen
#220 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
372
Forks
175
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

https://github.com/graphql-python/graphql-core/blame/master/graphql/utils/schema_printer.py#L132
```python
def _print_object(type):
# type: (GraphQLObjectType) -> str
interfaces = type.interfaces
implemented_interfaces = (
" implements {}".format(", ".join(i.name for i in interfaces))
if interfaces
else ""
)
```
https://facebook.github.io/graphql/draft/#sec-Interfaces
```gql
type Business implements NamedEntity & ValuedEntity {
name: String
value: Int
employeeCount: Int
}
```

I do think we can use `&` instead of `,` here, so we can simply print schema to a file rather than fetching it through [graphql get-schema](https://github.com/graphql-cli/graphql-cli) in JavaScript world.
I compare both of them which was generated in my project and find the only difference, [even better with descriptions](https://github.com/graphql-python/graphql-core/issues/217).
Thanks!

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Open graphql/utils/schema_printer.py and inspect _print_object at the referenced line. Compare its printed interface syntax with the GraphQL draft example and the output from graphql-cli; done means the schema printer emits valid SDL for objects implementing multiple interfaces.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
api
Issue-Typ
Bug
Schwierigkeit
1/5
Geschätzter Aufwand
Unter einer Stunde
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.