Gato GraphQL logo

Response Error Trigger

Response Error Trigger

This module adds global field _fail and directive @fail to the GraphQL schema, which add an entry to the errors property in the response.

query {
  _fail(message: "Some error")
  
  posts {
    featuredImage @fail(
      message: "The post does not have a featured image"
    ) {
      id
      src
    }
  }
}