I have a GraphQL query like this:
import { gql } from 'apollo-boost';
export default gql`
{
pageHomeCollection(limit: 1) {
items {
navigationLinkLeft {
... on PageBasic {
slug
title
}
... on PageShop {
title
}
... on PostCollection {
slug
title
}
}
navigationLinkRight {
... on PageBasic {
slug
title
}
... on PageShop {
title
}
... on PostCollection {
slug
title
}
}
title
}
}
}
`;
The requested data for both navigationLinkLeft
and navigationLinkRight
are the same, so I'd like to avoid the duplication. I know about fragments, but not sure if it's possible to extract the 3 ... on
because I'm not sure what type the fragment would be. Is this possible?