```swift extension GraphQLRequest { static func getPostWithComments(byId id: String) -> GraphQLRequest { let document = """ query getPost($id: ID!) { getPost(id: $id) { id title rating status comments { items { id postID content } } } } """ return GraphQLRequest( document: document, variables: ["id": id], responseType: Post.self, decodePath: "getPost" ) } } ``` Query with `Amplify.API.query(request: .getPostWithComments(byId: "[POST_ID]"))`.