-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
2fb8092
commit ba228a4
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# GraphQL Data Connector | ||
|
||
Follow these steps to get started with GraphQL as a Data Connector. | ||
|
||
**Step 1.** Edit the `spicepod.yaml` file in this directory and replace the params in the `graphql_quickstart` dataset with the connection parameters for your GraphQL instance, where `[local_table_name]` is your desired name for the federated table, `[graphql_endpoint]` is the url to your GraphQL endpoint, `[graphql_query]` is the query to execute, and `[json_path]` is the path to the data in the GraphQL response. | ||
|
||
For authentication options see [GraphQL Data Connector docs](https://docs.spiceai.org/data-connectors/graphql#configuration) | ||
|
||
Follow the [quickstart guide](https://docs.spiceai.org/getting-started) to get started with the Spice.ai runtime. | ||
|
||
See the [datasets reference](https://docs.spiceai.org/reference/spicepod/datasets) for more dataset configuration options. | ||
|
||
To securely store your GraphQL auth params, see [Secret Stores](https://docs.spiceai.org/secret-stores) | ||
|
||
**Step 2.** Run the Spice runtime with `spice run` from this directory. | ||
|
||
**Step 3.** Run `spice sql` in a new terminal to start an interactive SQL query session against the Spice runtime. | ||
|
||
For more information on using `spice sql`, see the [CLI reference](https://docs.spiceai.org/cli/reference/sql). | ||
|
||
**Step 4.** Execute the query `select * from [local_table_name];` to see GraphQL response accelerated locally. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: v1beta1 | ||
kind: Spicepod | ||
name: graphql_quickstart | ||
datasets: | ||
- from: graphql:[graphql_endpoint] | ||
name: [local_table_name] | ||
params: | ||
json_path: [json_path] | ||
query: | | ||
[graphql_query] | ||
acceleration: | ||
enabled: true | ||
refresh_mode: full | ||
refresh_check_interval: 15s |