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

```
Query with `try await Amplify.API.query(request: .getPostWithComments(byId: "[POST_ID]"))`.
