GraphQL - SWAPI clone

GoGoDev·2022년 2월 15일
0

GraphQL

목록 보기
2/4

SWAPI

스타워즈 API

git Clone

git clone https://github.com/graphql/swapi-graphql.git

VSCODE

swapi-graphql을 vscode에서 연 후, npm install을 해준다.

npm install

npm start

npm start를 하면 http://localhost:portNUmber 로 뜬다.
port Number는 npm start를 할 때마다 바뀐다.
주소 뒤에 graphiql 엔드포인트를 붙여야 SWAPI를 사용할 수 있다.
(http://localhost:portNumber/graphiql)

파일 구조


GraphQL은 혼자 동작하지 않고 여러 dependencies가 필요하다 (package.json에서 확인)

실행


파일 목록 상단에 있는 doc\example_queries에서 다양한 예시들을 적용해보고 다양한 데이터를 조회해보자.

profile
🐣차근차근 무럭무럭🐣

0개의 댓글