-
I am wondering what the best way for customizing the connection types generated for Let's say I want to implement a GraphQL service matching this example from the Introduction to GraphQL which has an extra query HeroComparison($first: Int = 3) {
leftComparison: hero(episode: EMPIRE) {
...comparisonFields
}
rightComparison: hero(episode: JEDI) {
...comparisonFields
}
}
fragment comparisonFields on Character {
name
friendsConnection(first: $first) {
totalCount
edges {
node {
name
}
}
}
} As far as I understand Is there a smarter way than replacing |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Currently, the only way to achieve that is to indeed write your own type factory. You can start by copy pasting the existing |
Beta Was this translation helpful? Give feedback.
Currently, the only way to achieve that is to indeed write your own type factory. You can start by copy pasting the existing
RelayConnectionFactory
. Moreover, you will need to choose a different directive as@connection
is already taken by the existing Relay implementation.