Docz: Gastby ์˜ค๋ฅ˜ : RelayParser-์ค‘๋ณต ๋ฌธ์„œ :-DefaultSEOQuery

์— ๋งŒ๋“  2019๋…„ 07์›” 04์ผ  ยท  10์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: doczjs/docz

๋ฒ„๊ทธ ์‹ ๊ณ 

๋ฒ„๊ทธ ์„ค๋ช…
๊ฐœ์ธ ๋น„ ๋นŒ๋“œ๊ฐ€ ์†์ƒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. https://www.docz.site/docs/gatsby-theme#how -to-use์˜ ์ง€์นจ์„ ๋”ฐ๋ž์Šต๋‹ˆ๋‹ค.

๋ฒ„๊ทธ๊ฐ€ ๋ฌด์—‡์ธ์ง€ ๋ช…ํ™•ํ•˜๊ณ  ๊ฐ„๊ฒฐํ•˜๊ฒŒ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค.

์ ์‹ฌ์„ ๋จน์„ ๋•Œ gatsby develop .

์žฌํ˜„ํ•˜๋ ค๋ฉด

  1. https://github.com/sutter/hello-gatsby/tree/feature/add-documentation '์œผ๋กœ ์ด๋™
  2. ๋ฆฌํฌ์ง€ํ† ๋ฆฌ๋ฅผ ๋ณต์ œํ•˜์—ฌ ์„ค์น˜ ๊ฐœ๋ฐœ์ž ์ข…์†์„ฑ์— ๋Œ€ํ•œ readme๋ฅผ ์ฝ์Šต๋‹ˆ๋‹ค.
โžœ  hello-gatsby git:(feature/add-documentation) gatsby develop
Configuring yargs through package.json is deprecated and will be removed in the
success open and validate gatsby-configs - 2.034 s
success load plugins - 0.970 s
Configuring yargs through package.json is deprecated and will be removed in the
success onPreInit - 0.312 s
success initialize cache - 0.006 s
success copy gatsby files - 0.066 s
success onPreBootstrap - 0.009 s
Configuring yargs through package.json is deprecated and will be removed in the
success source and transform nodes - 0.532 s
success building schema - 0.287 s
Configuring yargs through package.json is deprecated and will be removed in the
success createPages - 0.309 s
success createPagesStatefully - 0.036 s
success onPreExtractQueries - 0.002 s
success update schema - 0.041 s

 ERROR 

There was a problem parsing "/Users/laurentsutterlity/Works/hello-gatsby/node_modules/gatsby-theme-docz/templates/Layout.tpl.js"; any GraphQL fragments or queries in this file were not processed.
This may indicate a syntax error in the code, or it may be a file type that Gatsby does not know how to parse.


 ERROR #85901  GRAPHQL

There was an error in your GraphQL query:

Error: RelayParser: Encountered duplicate defintitions for one or more documents: each document must have a unique name. Duplicated documents:
- DefaultSEOQuery

success extract queries from components - 8.357 s
success write out requires - 0.008 s
success write out redirect data - 0.002 s
success Build manifest and related icons - 0.137 s
success onPostBootstrap - 0.144 s
โ €
info bootstrap finished - 17.704 s
โ €
success run static queries - 0.002 s
success run page queries - 0.026 s โ€” 7/7 292.91 queries/second
 DONE  Compiled successfully in 6477ms                                    09:12:11
โ €
You can now view hello-gatsby in the browser.
โ €
  http://localhost:8000/
โ €
View GraphiQL, an in-browser IDE, to explore your site's data and schema
โ €
  http://localhost:8000/___graphql
โ €
Note that the development build is not optimized.
To create a production build, use npm run build

ํ™˜๊ฒฝ

  • OS : [10.14.5]
  • ๋…ธ๋“œ ๋ฒ„์ „ : [v10.15.3]
  • ์›์‚ฌ ๋ฒ„์ „ : [1.15.2]
bug stale v1

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

๋ˆ„๊ตฐ๊ฐ€ v2๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ, gatsby๊ฐ€ ์ตœ์‹  ์ƒํƒœ์ธ์ง€ ํ™•์ธํ•˜๊ณ  ๊ดœ์ฐฎ์„ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์–ด๋–ค ์ด์œ ๋กœ ๋“  v1 (๋‚˜์™€ ๊ฐ™์€)์— ๋ถ™์–ด์žˆ๋Š” ์‚ฌ๋žŒ์ด๋ผ๋ฉด docz gatsby์—์„œ ํŒŒ์ผ์„ ๋ณ€๊ฒฝํ•˜์—ฌ ๋กœ์ปฌ์—์„œ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ…Œ๋งˆ node_modules ์˜ ์ฃผ๋œ ๋‹จ์ ์€ ์ข…์†์„ฑ์„ ์ถ”๊ฐ€ํ•˜๊ฑฐ๋‚˜ ์—…๋ฐ์ดํŠธ ํ•  ๋•Œ๋งˆ๋‹ค ์ˆ˜์ • ์‚ฌํ•ญ์„ ๋ฎ์–ด ์“ฐ์ง€๋งŒ, ์ œ ๋นŒ๋“œ์˜ ์ผ๋ถ€๋กœ ํŒŒ์ผ์„ ๊ต์ฒดํ•˜๋Š” ๊ฒƒ๋งŒ์œผ๋กœ๋„ ์™„์ „ํžˆ ์ž๋™ํ™” ๋œ ์ƒํƒœ๋กœ ์œ ์ง€ํ•  ์ˆ˜ ์žˆ๋‹ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

์ฃผ๋œ ๋ฌธ์ œ๋Š” node_modules/gatsby-theme-docs/templates/Seo.js.tpl ํŒŒ์ผ์ด ์ฟผ๋ฆฌ๋ฅผ ๋‚ด๋ณด๋‚ด๊ณ  ๋‹ค๋ฅธ ํŒŒ์ผ์„ ์ƒ์„ฑํ•˜๊ธฐ์œ„ํ•œ ํ…œํ”Œ๋ฆฟ์œผ๋กœ ์˜๋„๋˜์—ˆ์ง€๋งŒ ์—ฌ์ „ํžˆ gatsby์— ์˜ํ•ด ์ฒ˜๋ฆฌ๋˜๊ธฐ ๋•Œ๋ฌธ์— ์ฟผ๋ฆฌ ์ด๋ฆ„์ด ์Šคํ‚ค๋งˆ์— ์ค‘๋ณต๋ฉ๋‹ˆ๋‹ค. ์ฆ‰ ์˜ค๋ฅ˜ . ๋”ฐ๋ผ์„œ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋ ค๋ฉด ์ฟผ๋ฆฌ ์ด๋ฆ„์„ ์ฟผ๋ฆฌ์—์„œ ์ œ๊ฑฐํ•˜๋ฉด๋ฉ๋‹ˆ๋‹ค. ์ฟผ๋ฆฌ ์ด๋ฆ„์€ ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ graphql์—์„œ๋งŒ ํ•„์š”ํ•˜๋ฏ€๋กœ์ด ์ฟผ๋ฆฌ์—๋Š” ์ด๋ฆ„์ด ํ•„์š”ํ•˜์ง€ ์•Š์œผ๋ฏ€๋กœ ํ•ด๋‹น ํŒŒ์ผ์—์„œ ๋ณ€๊ฒฝํ•˜๊ธฐ ๋งŒํ•˜๋ฉด๋ฉ๋‹ˆ๋‹ค.

query DefaultSeoQuery {

์œผ๋กœ

query {

๋ชจ๋“  10 ๋Œ“๊ธ€

์ด๊ฒƒ์€ Gatsby์˜ ์ƒˆ ๋ฒ„์ „๊ณผ ๊ด€๋ จ๋œ ๋ฒ„๊ทธ์ž…๋‹ˆ๋‹ค. ๋‚˜๋Š” ๊ทธ๋“ค์ด ์ด๊ฒƒ์„ ๊ณ ์น˜๊ธฐ ์œ„ํ•ด ๋…ธ๋ ฅํ•˜๊ณ  ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.
cc @pieh

์—ฌ๊ธฐ์— ๋น„์Šทํ•œ ๋ฌธ์ œ

๊ฐ™์€ ๋ฌธ์ œ๋„ ์•ˆํƒ€๊น๊ฒŒ๋„ ์—ฌ์ „ํžˆ ์ž‘๋™ ํ•  ์ˆ˜์žˆ๋Š” ์ด์ „ ๋ฒ„์ „์˜ Gatsby๊ฐ€ ์žˆ๋Š”์ง€ ๋˜๋Š” ์ด์ „ ๋ฒ„์ „์„ ๊ณ ๋ คํ•˜๋Š” ๊ฒƒ์ด ์ข…์†์„ฑ ์—‰๋ง์ธ์ง€ ์•Œ๊ณ  ์žˆ์Šต๋‹ˆ๊นŒ?

Docz ํ…Œ๋งˆ๋ฅผ ์„ค์น˜ ํ•œ ํ›„ ๋น„์Šทํ•œ ๋ฌธ์ œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

ํŽธ์ง‘ : ์‚ฌ์‹ค, ๋˜‘๊ฐ™์€ ๋ฌธ์ œ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.
ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์ด ์žˆ์Šต๋‹ˆ๊นŒ?

Docz ํ…Œ๋งˆ๋ฅผ ์„ค์น˜ ํ•œ ํ›„๋„ ๋งˆ์ฐฌ๊ฐ€์ง€์ž…๋‹ˆ๋‹ค.

ํŽธ์ง‘ :์ด ๋ฌธ์ œ์— ๋Œ€ํ•œ ๋‰ด์Šค๊ฐ€ ์žˆ์Šต๋‹ˆ๊นŒ?

v2๋กœ ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜์„ ์‹œ๋„ํ•œ ํ›„์—๋„์ด ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  Gatsby์™€ ๊ด€๋ จ๋œ ๊ฒฝ์šฐ v1 ํƒœ๊ทธ๊ฐ€์žˆ๋Š” ์ด์œ ๋Š” ๋ฌด์—‡์ž…๋‹ˆ๊นŒ?

v2.0.0-rc.31 ์—์„œ์ด ๋ฌธ์ œ์— ์ง๋ฉด ํ•จ ๐Ÿ˜ฌ

๋ˆ„๊ตฐ๊ฐ€ v2๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ, gatsby๊ฐ€ ์ตœ์‹  ์ƒํƒœ์ธ์ง€ ํ™•์ธํ•˜๊ณ  ๊ดœ์ฐฎ์„ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์–ด๋–ค ์ด์œ ๋กœ ๋“  v1 (๋‚˜์™€ ๊ฐ™์€)์— ๋ถ™์–ด์žˆ๋Š” ์‚ฌ๋žŒ์ด๋ผ๋ฉด docz gatsby์—์„œ ํŒŒ์ผ์„ ๋ณ€๊ฒฝํ•˜์—ฌ ๋กœ์ปฌ์—์„œ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ…Œ๋งˆ node_modules ์˜ ์ฃผ๋œ ๋‹จ์ ์€ ์ข…์†์„ฑ์„ ์ถ”๊ฐ€ํ•˜๊ฑฐ๋‚˜ ์—…๋ฐ์ดํŠธ ํ•  ๋•Œ๋งˆ๋‹ค ์ˆ˜์ • ์‚ฌํ•ญ์„ ๋ฎ์–ด ์“ฐ์ง€๋งŒ, ์ œ ๋นŒ๋“œ์˜ ์ผ๋ถ€๋กœ ํŒŒ์ผ์„ ๊ต์ฒดํ•˜๋Š” ๊ฒƒ๋งŒ์œผ๋กœ๋„ ์™„์ „ํžˆ ์ž๋™ํ™” ๋œ ์ƒํƒœ๋กœ ์œ ์ง€ํ•  ์ˆ˜ ์žˆ๋‹ค๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.

์ฃผ๋œ ๋ฌธ์ œ๋Š” node_modules/gatsby-theme-docs/templates/Seo.js.tpl ํŒŒ์ผ์ด ์ฟผ๋ฆฌ๋ฅผ ๋‚ด๋ณด๋‚ด๊ณ  ๋‹ค๋ฅธ ํŒŒ์ผ์„ ์ƒ์„ฑํ•˜๊ธฐ์œ„ํ•œ ํ…œํ”Œ๋ฆฟ์œผ๋กœ ์˜๋„๋˜์—ˆ์ง€๋งŒ ์—ฌ์ „ํžˆ gatsby์— ์˜ํ•ด ์ฒ˜๋ฆฌ๋˜๊ธฐ ๋•Œ๋ฌธ์— ์ฟผ๋ฆฌ ์ด๋ฆ„์ด ์Šคํ‚ค๋งˆ์— ์ค‘๋ณต๋ฉ๋‹ˆ๋‹ค. ์ฆ‰ ์˜ค๋ฅ˜ . ๋”ฐ๋ผ์„œ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋ ค๋ฉด ์ฟผ๋ฆฌ ์ด๋ฆ„์„ ์ฟผ๋ฆฌ์—์„œ ์ œ๊ฑฐํ•˜๋ฉด๋ฉ๋‹ˆ๋‹ค. ์ฟผ๋ฆฌ ์ด๋ฆ„์€ ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ graphql์—์„œ๋งŒ ํ•„์š”ํ•˜๋ฏ€๋กœ์ด ์ฟผ๋ฆฌ์—๋Š” ์ด๋ฆ„์ด ํ•„์š”ํ•˜์ง€ ์•Š์œผ๋ฏ€๋กœ ํ•ด๋‹น ํŒŒ์ผ์—์„œ ๋ณ€๊ฒฝํ•˜๊ธฐ ๋งŒํ•˜๋ฉด๋ฉ๋‹ˆ๋‹ค.

query DefaultSeoQuery {

์œผ๋กœ

query {

์†”๋ฃจ์…˜์— ๋Œ€ํ•ด @jstacoder ์—๊ฒŒ ๊ฐ์‚ฌ๋“œ๋ฆฝ๋‹ˆ๋‹ค

@jstacoder ์˜ ์†”๋ฃจ์…˜์„ ์‚ฌ์šฉํ•˜์—ฌ ๋นŒ๋“œ ๋‹จ๊ณ„์˜ ์ผ๋ถ€๋กœ node_modules ๋ฅผ ์ง€์†์ ์œผ๋กœ ๋ณ€๊ฒฝํ•˜๋Š” ๊ฒฝ์šฐ patch-package ๋ฅผ ํ™•์ธํ•˜์‹ญ์‹œ์˜ค.

์ด ๋ฌธ์ œ๋Š” ์ตœ๊ทผ ํ™œ๋™์ด ์—†์—ˆ๊ธฐ ๋•Œ๋ฌธ์— ์ž๋™์œผ๋กœ ์˜ค๋ž˜๋œ ๊ฒƒ์œผ๋กœ ํ‘œ์‹œ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ๋” ์ด์ƒ ํ™œ๋™์ด ๋ฐœ์ƒํ•˜์ง€ ์•Š์œผ๋ฉด ํ์‡„๋ฉ๋‹ˆ๋‹ค. ๊ท€ํ•˜์˜ ๊ธฐ์—ฌ์— ๊ฐ์‚ฌ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰