Hi,
I want to extend a type to have more information from a subgraph to have some new fields but it requires an argument passed into a parent type. I will use an example below:
I have two subgraphs a book subgraph and a summary subgraph, the summary subgraph extends the chapter type. To achieve this though the summary graph needs access to the book id field and Im unsure the best approach.
# book graph
type Book {
id: String
chapters: Chapter
}
type Chapter @key(fields: "?"){
title: String
numberOfPages: Int
}
type Query {
bookById(id: String!): Book
}
# summary graph
type Chapter @key(fields: "?"){
summary: String
}
I could add an argument into the summary field for book id but this doesnt feel the best as its not strictly needed in the graph.
Alternatively I could add the bookId into the chapter.
I was looking for what is best practice?