Skip to main content

llama-index readers graphql integration

Project description

GraphQL Loader

pip install llama-index-readers-graphql

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

import os

from llama_index.readers.graphql import 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.

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

llama_index_readers_graphql-0.3.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file llama_index_readers_graphql-0.3.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_readers_graphql-0.3.0.tar.gz
Algorithm Hash digest
SHA256 05f0a4fa7bd5e9285bd57cc8a4f30b07217053454ab21a250f8aabdf4e8f23b3
MD5 9f7c55091349d581bc2fb4ff95286d7e
BLAKE2b-256 f7877c2179f3e3f306581e4d73c9a07ca98be15ca797a30281f284eafc298e08

See more details on using hashes here.

File details

Details for the file llama_index_readers_graphql-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_readers_graphql-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 928390f058ec40998dd9efe336c29c0711525a047315924370361df2ddfb4b22
MD5 7f27417069418e2c21cc0119c354cb48
BLAKE2b-256 4d4fc7307bc7df7f3fd8f2ed29480134c5b500f92eeb39a91613501da9221fb1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page