단순 레코드 구독
Archie Core의 자동 생성된 GraphQL 구독 작업을 사용하여 생성, 업데이트 및 삭제되는 레코드를 구독할 수 있습니다.
다음 예제에서는 id, firstName, email과 같은 필드 및 관계를 포함하는 students라는 테이블이 있습니다.
구독 생성
섹션 제목: “구독 생성”생성되는 테이블 레코드를 수신하기 위한 구독입니다.
GraphQL 뮤테이션
섹션 제목: “GraphQL 뮤테이션”mutation createSubscription($input: SubscriptionInput!) { system { createSubscription(input: $input) { id active name } }}{ "input": { "name": "students_create", "description": "Subscription - students table, operation create", "active": true, "tables": [ { "table": "students", "operations": ["CREATE"], "fields": ["id", "first_name", "email"] } ] }}{ "data": { "system": { "createSubscription": { "id": "id_subscription", "active": true, "name": "students_create" } } }}구독 업데이트
섹션 제목: “구독 업데이트”업데이트되는 테이블 레코드를 수신하기 위한 구독입니다.
GraphQL 뮤테이션
섹션 제목: “GraphQL 뮤테이션”mutation updateSubscription ($input: SubscriptionInput!) { system { updateSubscription( input: $input ) { id name description } }}{ "input": { "id": "id_subscription", "name": "students_create", "description": "Subscription - students table, operation create", "active": true, "tables": [ { "table": "students", "operations": ["UPDATE", "CREATE", "DELETE"], "fields": ["id", "first_name"] } ] }}{ "data": { "system": { "updateSubscription": { "id": "id_subscription", "name": "students_create", "description": "Subscription - students table, operation create" } } }}구독 삭제
섹션 제목: “구독 삭제”삭제되는 테이블 레코드를 수신하기 위한 구독입니다.
GraphQL 뮤테이션
섹션 제목: “GraphQL 뮤테이션”mutation deleteSubscription($id: String!) { system { deleteSubscription(id: $id) }}{ "id": "id_subscription"}{ "data": { "system": { "deleteSubscription": true } }}