import ChangeLog from ‘../changelog/connector-graphql.md’;
GraphQL source connector
Used to read data from GraphQL.
| name | type | required | default value |
|---|---|---|---|
| url | String | Yes | - |
| query | String | Yes | - |
| variables | Config | No | - |
| enable_subscription | boolean | No | false |
| timeout | Long | No | - |
| content_field | String | Yes | $.data.{query_object}.* |
| schema.fields | Config | Yes | - |
| format | String | No | json |
| params | Map | Yes | - |
| poll_interval_millis | int | No | - |
| retry | int | No | - |
| retry_backoff_multiplier_ms | int | No | 100 |
| retry_backoff_max_ms | int | No | 10000 |
| enable_multi_lines | boolean | No | false |
| common-options | config | No | - |
http request url
GraphQL expression query string
GraphQL Variables
for example
variables = {
limit = 2
}
Time-out Period
JSONPath wildcard
http request params
request http api interval(millis) in stream mode
The max retry times if request http return to IOException
The retry-backoff times(millis) multiplier if request http failed
The maximum retry-backoff times(millis) if request http failed
the format of upstream data, default json.
Fill in a fixed value
schema = { fields { metric = "map<string, string>" value = double time = long } }
the schema fields of upstream data
Source plugin common parameters, please refer to Source Common Options for details
source { GraphQL { url = "http://192.168.1.103:9081/v1/graphql" format = "json" content_field = "$.data.source" query = """ query MyQuery($limit: Int) { source(limit: $limit) { id val_bool val_double val_float } } """ variables = { limit = 2 } schema = { fields { id = "int" val_bool = "boolean" val_double = "double" val_float = "float" } } } }
source { GraphQL { url = "http://192.168.1.103:9081/v1/graphql" format = "json" content_field = "$.data.source" query = """ query MyQuery($limit: Int) { source(limit: $limit) { id val_bool val_double val_float } } """ variables = { limit = 2 } enable_subscription = true schema = { fields { id = "int" val_bool = "boolean" val_double = "double" val_float = "float" } } } }