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

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

Ouverte
#220 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
372
Forks
175
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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!

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Piste de recherche

Ouvrez graphql/utils/schema_printer.py et examinez _print_object à la ligne référencée. Comparez la syntaxe d’interface imprimée avec l’exemple du brouillon de GraphQL et la sortie de graphql-cli ; c’est terminé lorsque le schema printer émet un SDL valide pour les objets implémentant plusieurs interfaces.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
api
Type d'issue
Bug
Difficulté
1/5
Temps estimé
Moins d'une heure
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.