-
Golang GraphQL 서버 #3 (Resolver)Golang 2021. 5. 1. 23:21
Golang graphQL Playground 사용법
zzihyeon.tistory.com/13 Golang GraphQL 서버 setting (gqlgen 사용) workspace directory를 생성한다. mkdir DevBasic go mod 설정을 한다. go mod init devbaisc gqlgen을 install한다. go get github.com/99de..
zzihyeon.tistory.com
에서 설정한 playground에서 query를 실행하면 아래와 같이 internal system error가 발생한다.
이는 resolver 함수를 작성하지 않았기 때문이다.
playground로 query 실행 아래의 CreateTodo와 Todos Resolver가 모두 error를 발생시키기 때문에 playground에서 error 메세지가 발생한다.
resolver들이 Panic으로 에러를 발생시킨다. 이제 panic을 지우고 빈 값을 return하도록 code를 변경하면 playground에서 error가 발생하지 않는다.
에러가 발생하지 않는다 이제 Resolver 함수가 원하는 값을 return하도록 변경해보자
'Golang' 카테고리의 다른 글
golang postgresql migrate 설정하기 (0) 2022.03.21 golang 에러 Fatal error: newproc: function arguments too large for new goroutine (0) 2021.11.14 Golang GraphQL 서버 #2 (playground) (0) 2021.04.27 Golang GraphQL 서버 #1 (gqlgen 사용) (0) 2021.04.27 Go mod 사용하기 (0) 2021.04.27