llama-index readers graphql integration
Project description
GraphQL Loader
This loader loads documents via GraphQL queries from a GraphQL endpoint. The user specifies a GraphQL endpoint URL with optional credentials to initialize the reader. By declaring the GraphQL query and optional variables (parameters) the loader can fetch the nested result docs.
Usage
Here's an example usage of the GraphQLReader. You can test out queries directly on the site
from llama_index import download_loader
import os
GraphQLReader = download_loader("GraphQLReader")
uri = "https://countries.trevorblades.com/"
headers = {}
query = """
query getContinents {
continents {
code
name
}
}
"""
reader = GraphQLReader(uri, headers)
documents = reader.query(query, variables={})
This loader is designed to be used as a way to load data into LlamaIndex and/or subsequently used as a Tool in a LangChain Agent. See here for examples.
It uses the gql GraphQL library for the GraphQL queries.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for llama_index_readers_graphql-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4cbef968b093682d1651621fe688b85d553ca89ffb2c2d9b4de5487e73e24c9 |
|
MD5 | 6973231a7662c3116c378778e65244fb |
|
BLAKE2b-256 | 6faf334e94025f54639a1ebf80895927dc03546f86b6b07723f5d2526ecb5733 |
Close
Hashes for llama_index_readers_graphql-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9d7d18d6d3744ef090106ea9ac6ec237765c89955733dc6f505cb3cd5ef6b7e |
|
MD5 | 5c8609d88558afc71ef73796537b3eb5 |
|
BLAKE2b-256 | 471f475f6454cfb6392c47071a8b593c4117c438db30078d48e0520fd9504344 |