Reputation: 101
For example, i have the next query for the paragraph:
query ParagraphText {
field_title
field_body
field_subtitle
field_image
field_button
}
And i use this paragraph on the front page. But also i use this paragraph on another page but i dont want this query to have button. Is there an opportunity to extend fragment?
fragment ParagraphText on paragraph__text {
field_title
field_body
field_subtitle
field_image
}
fragment ParagraphTextWithButton extends ParagraphText {
field_button
}
Upvotes: 3
Views: 1856
Reputation: 80041
You can expand a fragment in a fragment definition to do this:
fragment ParagraphText on paragraph__text {
field_title
field_body
field_subtitle
field_image
}
fragment ParagraphTextWithButton on paragraph__text {
...ParagraphText
field_button
}
Upvotes: 6