사용 중단
사용 중단Deprecation Notifier

Deprecation Notifier

Included in the “Power Extensions” bundle

쿼리에 대한 응답에서 더 이상 사용되지 않는 항목을 전송합니다(introspection 실행 시뿐만 아니라). 전송 대상은 최상위 항목 extensions입니다.

설명

더 이상 사용되지 않는 필드가 쿼리될 때마다, 동일한 GraphQL 응답의 최상위 항목 extensions에 사용 중단 메시지가 반환됩니다.

이를 통해 API 사용자는 introspection 쿼리에 주의를 기울이지 않더라도 스키마 사용 방식을 업그레이드하도록 알림을 받습니다.

예를 들어, 필드 isPublished가 더 이상 사용되지 않는 경우, 다음 쿼리를 실행하면:

query {
  posts {
    title
    isPublished
  }
}

...다음과 같은 응답이 반환됩니다:

{
  "extensions": {
    "deprecations": [
      {
        "message": "Use 'isStatus(status:published)' instead of 'isPublished'",
        "extensions": {
          ...
        }
      }
    ]
  },
  "data": {
    "posts": [
      ...
    ]
  }
}