You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 20, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: docs/docs/third-party-graphql.md
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,44 +1,44 @@
1
1
---
2
-
title: Using Third-party GraphQL APIs
2
+
title: サードパーティー製GraphQL APIの使用
3
3
---
4
4
5
-
Gatsby v2 introduces a simple way to integrate any GraphQL API into Gatsby's GraphQL. You can integrate both third-party APIs, like GitHub's, APIs of services like GraphCMS or your custom GraphQL API.
5
+
Gatsby v2 は、簡単な方法でどんな GraphQL API でも Gatsby の GraphQL に統合できます。 たとえば、GitHub などのサードパーティー API、GraphCMS などサービスの API、あるいは独自の GraphQL API などです。
6
6
7
-
## Basic example
7
+
## 基本的な例
8
8
9
-
First install the plugin.
9
+
最初に、プラグインをインストールします。
10
10
11
11
```shell
12
12
npm install gatsby-source-graphql
13
13
```
14
14
15
-
Provided there is a GraphQL API under a `url`, adding it to an API just requires adding this to the config.
15
+
`url`の下に GraphQL API がある場合、それを API に追加するには以下を設定に追加するだけです。
16
16
17
17
```js:title=gatsby-config.js
18
18
module.exports= {
19
19
plugins: [
20
20
{
21
21
resolve:"gatsby-source-graphql",
22
22
options: {
23
-
//This type will contain remote schema Query type
23
+
//このタイプには、リモートスキーマのクエリタイプが含まれます
24
24
typeName:"SWAPI",
25
-
//This is the field under which it's accessible
25
+
//これはアクセス可能なフィールドです
26
26
fieldName:"swapi",
27
-
//URL to query from
27
+
//クエリ元のURLです
28
28
url:"https://api.graphcms.com/simple/v1/swapi",
29
29
},
30
30
},
31
31
],
32
32
}
33
33
```
34
34
35
-
See all configuration options in the [plugin docs](/packages/gatsby-source-graphql)
Third-party APIs will be available under the `fieldName` specified, so you can query through it normally.
37
+
サードパーティーの API は、指定された`fieldName`で使用できるため、通常どおりクエリを実行できます。
38
38
39
39
```graphql
40
40
{
41
-
# Field name parameter defines how you can access a third-party API
41
+
# フィールド名パラメーターは、サードパーティーのAPIにアクセスする方法を指定します
42
42
swapi {
43
43
allSpecies {
44
44
name
@@ -47,11 +47,11 @@ Third-party APIs will be available under the `fieldName` specified, so you can q
47
47
}
48
48
```
49
49
50
-
Note that types of the third-party API will be prefixed with `${typeName}_`. You need to prefix it too, e.g. when using variables or fragments.
50
+
サードパーティー API のタイプには、`${typeName}_`という接頭辞が付きます。変数またはフラグメントを使用する場合などにも、接頭辞が必要です。
51
51
52
52
```graphql
53
53
{
54
-
# Field name parameter defines how you can access third-party API
54
+
# フィールド名パラメーターは、サードパーティーAPIにアクセスする方法を指定します
55
55
swapi {
56
56
allSpecies {
57
57
...onSWAPI_Species {
@@ -62,9 +62,9 @@ Note that types of the third-party API will be prefixed with `${typeName}_`. You
62
62
}
63
63
```
64
64
65
-
## Creating pages dynamically through third-party APIs
65
+
## サードパーティー API を使用してページを動的に作成する
66
66
67
-
You can also create pages dynamically by adding a `createPages` callback in `gatsby-node.js`. For example you can create a page for every Star Wars species.
0 commit comments