graphql
graphql์ ํ์ฉํ์ฌ, ๋ฐ์ดํฐ๋ฅผ ๋ถ๋ฌ์ค๊ฑฐ๋ ์์ ํ๋ ์ปดํฌ๋ํธ๊ฐ ์๋ค.
graphql-client
properties: endpoint
์
๋ ฅ๋ฐ์ endpoint์ ๋ฐ์ดํฐ๋ฅผ requestํ๋ client ์ปดํฌ๋ํธ์
๋๋ค. ๋ค๋ฅธ ์ปดํฌ๋ํธ์์ ์ฃผ๋ก ์ฐธ์กฐํ์ฌ ์ฌ์ฉํ๊ธฐ ๋๋ฌธ์ ID๊ฐ์ ์ง์ ํด์ฃผ์ด์ผ ํฉ๋๋ค.
graphql-query
properties: client, period, query
graphql-client์ id๋ฅผ ์ฐธ์กฐํ์ฌ, ์
๋ ฅํ ์ฃผ๊ธฐ๋๋ก ํด๋น ํด๋ผ์ด์ธํธ์ graphql query๋ฅผ ํตํด ๋ฐ์ดํฐ๋ฅผ ์์ฒญํ์ฌ ๋ฐ์์ค๋ ์ปดํฌ๋ํธ์
๋๋ค.
graphql-quick-bind-query
properties: client, period, query
์์ graphql-query์ ๋์ผํ ์ญํ ์ ํ์ง๋ง, query์ quick-bind๊ธฐ๋ฅ์ ํ์ฉํ์ฌ, ๋ณํํ๋ ๊ฐ์ ์ฟผ๋ฆฌ์ ๋ฃ์ด ์กฐํํ ์ ์๋๋ก ๋๋ ์ปดํฌ๋ํธ์
๋๋ค. quick-bind ์ฌ์ฉ๋ฐฉ๋ฒ์ query๋ฌธ ๋ด์ ๋ณํํ๋ ์ฐธ์กฐ๊ฐ์ ์
๋ ฅํ๋ ๋ถ๋ถ์ ${์ฐธ์กฐํ ์ปดํฌ๋ํธID.ํ๋กํผํฐ๋ช
} ํ์์ผ๋ก ์
๋ ฅํ๋ฉด ๋ฉ๋๋ค. period์ ๊ด๊ณ์์ด ๋ฐ์ดํฐ๊ฐ ํน์ ์ปดํฌ๋ํธ ๊ฐ์ด ๋ณ๊ฒฝ๋ ๋๋ง๋ค ๊ฐ์ ธ์ค๊ณ ์ถ์ ๊ฒฝ์ฐ, graphql-quick-bind-query์ปดํฌ๋ํธ์ value ๊ฐ์ผ๋ก ๋ฐ์ดํฐ๋ฅผ ๋๊ฒจ์ฃผ๋ฉด, ๊ทธ๋๋ง๋ค ๋ฐ์ดํฐ๋ฅผ ์๋ก ์กฐํํ ์ ์์ต๋๋ค.
graphql-quick-bind-mutation
properties: client, updateGql
updateGql์ ๋ฐ๋ผ ํด๋น ํด๋ผ์ด์ธํธ๋ฅผ ํตํด ๋ฐ์ดํฐ๋ฅผ ์
๋ฐ์ดํธํด์ค๋๋ค. graphql-quick-bind-query์ ๋ง์ฐฌ๊ฐ์ง๋ก quick-bind ๋ฐฉ์์ ์ฌ์ฉํ ์ ์์ต๋๋ค.
node package๋ฅผ ์ค์นํ๋ค.
$ yarn
์คํ
$ yarn serve
$ yarn serve:dev
ํฌํธ๋ฅผ ๋ฐ๊พธ๋ ค๋ฉด, -p 3001 ์์ผ๋ก ์ถ๊ฐํด์ค๋ค.
$ yarn serve
$ yarn serve -p 3001
test in browser
http://localhost:3000
build
$ yarn build
UMD | things-scene-graphql.js | modern browser | O |
UMD | things-scene-graphql-ie.js | ie 11 | O |
ESM | things-scene-graphql.mjs | modern browser | O |
publish
$ yarn publish