-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
💭 Strawman (RFC 0)RFC Stage 0 (See CONTRIBUTING.md)RFC Stage 0 (See CONTRIBUTING.md)
Description
As projects like Relay have shown, it's relatively common to repeat the same generic structures of types multiple times within a project. In the case of Relay, I'm talking about Connections.
The GraphQL definition language already has explicit support for one particular form of generic type, arrays:
type Foo {
id: ID!
bars: [Bar]
}
I'd like to start discussion about being able to do something similar for user-defined structures:
generic ConnectionEdge<T> {
node: T
cursor: String
}
generic Connection<T> {
edges: ConnectionEdge<T>
pageInfo: PageInfo
}
type Foo {
id: ID!
bars: Connection<Bar>
}
The overall goal is to reduce the amount of boilerplate in creating schemas with repetitive structures.
benwilson512, akre54, tberman, charlieschwabacher, orls and 265 morecrubiermathroc, nalejandroveron, raderio, Hossein-s, choonkending and 58 moresmmoosavi, jsbroks, haversnail-cbs, dazzito, nmokkenstorm and 10 more
Metadata
Metadata
Assignees
Labels
💭 Strawman (RFC 0)RFC Stage 0 (See CONTRIBUTING.md)RFC Stage 0 (See CONTRIBUTING.md)