Support extending interfaces
Reporting issues with GraphQL-core 3
The GraphQL protocol already supports interfaces extending other interfaces like
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
type SomeResource implements Resource & Identifiable {
id: ID!
name: String
}
But its a bit annoying
Hi @sebastiandev. Your example should actually work. Which version of GraphQL-core are you using and can you post the exact code that produces this error?
Just noticed this was implemented in v3.1 only. Maybe you're still on v3.0?
I'm on 3.1.6 using Ariadne. Looks like it supports an interface implementing another, but then it shows that error message
interface Node {
id: String!
}
type PageInfo {
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}
interface Identifiable implements Node {
id: String!
legacy_id: Int
}
type AccountEdge {
cursor: String!
node: Account
}
type AccountConnection {
pageInfo: PageInfo!
edges: [AccountEdge]
}
type Account implements Identifiable {
id: String!
legacy_id: Int
email: String
customers: AccountConnection
}
Hm, I still can't reproduce it with 3.1. Can you double-check the version with print(graphql.version_info) and post some Python code (not just SDL) that creates the error message above?