Last active
May 6, 2018 09:50
-
-
Save nicolasdao/86188d6a6618138a106adad190e4e641 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# schema.graphql file | |
# Magic Generic Type. | |
type Paged<T> { | |
data: [T] | |
cursor: ID | |
} | |
type Node { | |
id: ID! | |
} | |
# Magic inheritance. The resulting Variant model | |
# will contain an "id" field. | |
type Variant inherits Node { | |
name: String! | |
shortDescription: String | |
} | |
# Magic inheritance. The resulting Product model | |
# will contain an "id" field. | |
type Product inherits Node { | |
name: String! | |
shortDescription: String | |
# Magic generic field. | |
variants: Paged<Variant> | |
} | |
type Query { | |
products(id: Int): [Product] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment