graphql-python / graphql-python/graphql-core

Support extending interfaces

Offen
#147 4 Kommentare 1 Reaktion 1 zugewiesene Person Beansprucht von @Cito Auf GitHub ansehen
question
Vorherrschende Sprache
Python
Sterne
531
Forks
146
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

# Reporting issues with GraphQL-core 3

The GraphQL protocol already supports interfaces extending other interfaces like
```graphql
interface Identifiable {
id: ID!
}

interface Resource implements Identifiable {
id: ID!
name: String!
}

type SomeResource implements Resource {
id: ID!
name: String!
}
```

When loading the schema we get an error
```
File "/usr/local/lib/python3.6/site-packages/graphql/type/validate.py", line 91, in assert_valid_schema
raise TypeError("\n\n".join(error.message for error in errors))
TypeError: Type SomeResource must implement Identifiable because it is implemented by Resource.
```
This can be solved by doing
```graphql
type SomeResource implements Resource & Identifiable {
id: ID!
name: String
}
```
But its a bit annoying

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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