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: README.md
+23-2Lines changed: 23 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,8 +101,29 @@ For example, if this field is set to `Bearer abc123` then the following header i
101
101
}
102
102
```
103
103
104
-
And in the action yaml:
105
-
`authorization: 'Bearer abc123'`
104
+
#### `axios_config` (optional)
105
+
106
+
Under the hood, the `http` backend uses [Axios](https://github.com/axios/axios) for data fetching. By default, Flat assumes you're interested in using the `GET` method to fetch data, but if you'd like to `POST` (e.g., sending a GraphQL query), the `axios_config` option allows you to override this behavior.
107
+
108
+
Specifically, the `axios_config` parameter should reflect a relative path to a `.json` file in your repository. This JSON file should mirror the shape of [Axios' request config parameters](https://github.com/axios/axios#request-config), with a few notable exceptions.
109
+
110
+
- `url`and `baseURL` will both be ignored, as the `http_url` specified above will take precedence.
111
+
- `headers`will be merged in with the authorization header described by the `authorization` parameter above. Please do not put secret keys here, as they will be stored in plain text!
112
+
- All `function` parameters will be ignored (e.g., `transformRequest`).
113
+
- The response type is always set to `responseType: 'stream'` in the background.
114
+
115
+
An example `axios_config` might look thusly if you were interested in hitting GitHub's GraphQL API ([here is a demo](https://github.com/githubocto/flat-demo-graphql)) 👇
0 commit comments