interfaces themselves are actually trivial!
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
{
|
||||
root {
|
||||
id
|
||||
name
|
||||
children {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
type Response struct {
|
||||
Root struct {
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Children []content `json:"children"`
|
||||
} `json:"root"`
|
||||
}
|
||||
|
||||
type content struct {
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
Vendored
+28
@@ -26,6 +26,34 @@ type User {
|
||||
authMethods: [AuthMethod!]!
|
||||
}
|
||||
|
||||
interface Content {
|
||||
id: ID!
|
||||
name: String!
|
||||
parent: Topic
|
||||
}
|
||||
|
||||
type Article implements Content {
|
||||
id: ID!
|
||||
name: String!
|
||||
parent: Topic!
|
||||
text: String!
|
||||
}
|
||||
|
||||
type Video implements Content {
|
||||
id: ID!
|
||||
name: String!
|
||||
parent: Topic!
|
||||
duration: Int!
|
||||
}
|
||||
|
||||
type Topic implements Content {
|
||||
id: ID!
|
||||
name: String!
|
||||
parent: Topic
|
||||
children: [Content!]!
|
||||
}
|
||||
|
||||
type Query {
|
||||
user(query: UserQueryInput): User
|
||||
root: Topic!
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user