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
Copy file name to clipboardExpand all lines: docsite/docs/provider.md
+36-3Lines changed: 36 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,9 @@ The latest release can be downloaded from the graphql provider [release page](ht
13
13
14
14
## Provider Configuration
15
15
16
-
This provider has only two configuration inputs: `url` & `headers`
16
+
This provider has several configuration inputs.
17
+
18
+
In most cases, only `url` & `headers` are used, e.g.:
17
19
18
20
```hcl
19
21
provider "graphql" {
@@ -26,12 +28,43 @@ provider "graphql" {
26
28
}
27
29
```
28
30
31
+
In some advanced cases where the GraphQL server exposes an endpoint to perform OAuth 2.0 authentication, instead of using `headers`, you can use `oauth2_login_query`, `oauth2_login_query_variables` and `oauth2_login_query_value_attribute`, e.g.:
-**Description**: `The GraphQL API url that the provider will use to make requests`
50
+
-**Description**: The GraphQL API url that the provider will use to make requests.
34
51
35
52
### headers
53
+
-**Required**: `false`
54
+
-**Type**: `map(string)`
55
+
-**Desciption**: Any http headers that the GraphQL API server requires (e.g. `Authentication`, `x-api-key`, etc.).
56
+
57
+
### oauth2_login_query
58
+
-**Required**: `false`
59
+
-**Type**: `string`
60
+
-**Description**: The GraphQL query or mutation used to retrieve an OAuth 2.0 access token from the GraphQL server. It will be executed once during provider initialization. Be aware that renewal is not implemented, which may cause issue with short-lived access tokens. Note: you must also define `oauth2_login_query_variables` and `oauth2_login_query_value_attribute` when using `oauth2_login_query`.
61
+
62
+
### oauth2_login_query_variables
63
+
-**Required**: `false`
36
64
-**Type**: `map(string)`
37
-
-**Desciption**: `Any http headers that the GraphQL API requires. (eg; Authentication; x-api-key; etc)`
65
+
-**Desciption**: A map of any variables that will be used in your OAuth 2.0 login query. Each variable's value is interpreted as JSON when possible. Note: you must also define `oauth2_login_query` and `oauth2_login_query_value_attribute` when using `oauth2_login_query_variables`.
66
+
67
+
### oauth2_login_query_value_attribute
68
+
-**Required**: `false`
69
+
-**Type**: `string`
70
+
-**Description**: The dot-separated path to the attribute containing the access token value that will be extracted from the OAuth 2.0 login query or mutation response (it must start with `data.`, e.g. `data.loginAPI.accessToken`). Note: you must also define `oauth2_login_query` and `oauth2_login_query_variables` when using `oauth2_login_query_value_attribute`.
0 commit comments