Let’s say graphql type definitions is
type Post {
id: ID!
tags: Tag
}
type Tag {
id: ID!
name
parentTag: Tag
}
type Query {
lastPost: Post
}
and the user query is
{
query {
lastPost {
tags {
name
parentTag {
name
}
}
}
}
}
and the Query.lastPost
resolver will return
{
"id": 1,
"tagIds": [5,6,7]
}
How do I extract what’s missing from inside the Query.lastPost
and get the result below?
const missingFields = `
tags {
name
parentTag {
name
}
}
`;