• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    미해결

linkSchema

22.06.01 15:44 작성 조회수 111

0

linkSchema 안에 default 값 주는 부분에서 type을 boolean으로 주는 이유가 있을까요???

답변 1

답변을 작성해보세요.

1

Modularizing your GraphQL schema code

위 링크에서 "Extending types in multiple files" 부분을 참고하세요.

Note: In the current version of GraphQL, you can't have an empty type even if you intend to extend it later. So we need to make sure the Query type has at least one field — in this case we can add a fake _empty field. Hopefully in future versions it will be possible to have an empty type to be extended later.

참고: 현 버전의 GraphQL에서는 설령 나중에 확장하려는 경우라 하더라도 비어있는(empty) 타입을 사용할 수 없습니다. 따라서 쿼리 유형에 최소한 하나 이상의 필드(이 경우 fake_empty 필드)가 있어야 합니다. 미래의 버전에서는 '나중에 확장될 빈 타입'을 가질 수 있길 바랍니다.

즉, boolean을 준 이유는 "그냥" 입니다. 뭐라도 줘야 하기에 아무 타입이나 지정한 거예요.