docs: upgrade to vuepress 1.x
This commit is contained in:
@@ -16,13 +16,21 @@ module.exports = {
|
||||
description: '🚀 在你的 Vue.js 应用中集成 GraphQL!',
|
||||
}
|
||||
},
|
||||
plugins: {
|
||||
'@vuepress/pwa': {
|
||||
serviceWorker: true,
|
||||
updatePopup: {
|
||||
'/': {
|
||||
message: "New content is available.",
|
||||
buttonText: "Refresh"
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
themeConfig: {
|
||||
repo: 'Akryum/vue-apollo',
|
||||
docsDir: 'docs',
|
||||
editLinks: true,
|
||||
serviceWorker: {
|
||||
updatePopup: true,
|
||||
},
|
||||
locales: {
|
||||
'/': {
|
||||
selectText: 'Languages',
|
||||
|
||||
@@ -226,7 +226,7 @@ Fragments are useful to share parts of GraphQL documents in other documents to r
|
||||
|
||||
Let's say we have this `GetMessages` query with a `messages` field that is an array of `Message` objects:
|
||||
|
||||
```gql
|
||||
```graphql
|
||||
query GetMessages {
|
||||
messages {
|
||||
id
|
||||
@@ -260,7 +260,7 @@ export default {
|
||||
|
||||
Here is what the `message` fragment, which is applied on the `Message` type, looks like:
|
||||
|
||||
```gql
|
||||
```graphql
|
||||
fragment message on Message {
|
||||
id
|
||||
user {
|
||||
@@ -307,7 +307,7 @@ gql`
|
||||
|
||||
Which will effectively produce this GraphQL document (that you can try on the GraphQL playground of your API):
|
||||
|
||||
```gql
|
||||
```graphql
|
||||
query GetMessages {
|
||||
messages {
|
||||
...message
|
||||
@@ -328,7 +328,7 @@ So what's happening here? GraphQL will find the `...` operator where we usually
|
||||
|
||||
In the end, we obtain the final query:
|
||||
|
||||
```gql
|
||||
```graphql
|
||||
query GetMessages {
|
||||
messages {
|
||||
id
|
||||
|
||||
@@ -227,7 +227,7 @@ export default {
|
||||
|
||||
假设我们有一个`GetMessages` 查询,带有一个类型是 `Message` 对象数组的 `messages` 字段:
|
||||
|
||||
```gql
|
||||
```graphql
|
||||
query GetMessages {
|
||||
messages {
|
||||
id
|
||||
@@ -261,7 +261,7 @@ export default {
|
||||
|
||||
以下是应用于 `Message` 类型的 `message` 片段,如下所示:
|
||||
|
||||
```gql
|
||||
```graphql
|
||||
fragment message on Message {
|
||||
id
|
||||
user {
|
||||
@@ -308,7 +308,7 @@ gql`
|
||||
|
||||
这将有效地生成 GraphQL 文档(你可以在你的 GraphQL API playground 上尝试):
|
||||
|
||||
```gql
|
||||
```graphql
|
||||
query GetMessages {
|
||||
messages {
|
||||
...message
|
||||
@@ -329,7 +329,7 @@ fragment message on Message {
|
||||
|
||||
最后,我们获得最终查询:
|
||||
|
||||
```gql
|
||||
```graphql
|
||||
query GetMessages {
|
||||
messages {
|
||||
id
|
||||
|
||||
+2
-1
@@ -10,6 +10,7 @@
|
||||
"docs:build": "vuepress build docs"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vuepress": "^0.14.2"
|
||||
"@vuepress/plugin-pwa": "^1.0.2",
|
||||
"vuepress": "^1.2.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user