Homepage
Link to WPGraphQL on Github
Link to WPGraphQL on WordPress.org

Deprecating a field in the Schema

Sometimes it can be helpful to deprecate a field in the Schema without removing it altogether.

This snippet shows how to deprecate the `Post.excerpt` field.

You can use this technique to deprecate other fields.

After using this snippet, we can verify in the WPGraphQL Schema Docs that the field is indeed deprecated:

Screenshot of the excerpt field showing deprecated in the GraphiQL IDE Schema Docs