Code
graphql
query GetUser($id: ID!, $withPosts: Boolean!) {
user(id: $id) {
id
name
posts @include(if: $withPosts) {
title
}
email @skip(if: true)
}
}
# Custom directive declaration
directive @deprecated(reason: String) on FIELD_DEFINITION
type Query {
oldField: String @deprecated(reason: "Use newField")
newField: String
}