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.4.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_readers_graphql-0.4.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for llama_index_readers_graphql-0.4.1.tar.gz
Algorithm Hash digest
SHA256 8f8d572323ae27a5f1afb6d975f56a2f8b7fc3d28a5a1073ba035fd4f8673907
MD5 e7362840dbe4204ed355e89780543b0e
BLAKE2b-256 26bae6dab9be460c9f1bd98b447a563c344d5b018f84c51758c5e3c0071235fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_readers_graphql-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 11cf2e17fa9387fde71540a3cd84fb06dbec14b271ea68152866d6f4ef214030
MD5 383ef1dd9e81b224bb3b942ea43b4af9
BLAKE2b-256 1037a013ca4b0cfd870fbd122d097df92b170fc51f08029915bbb3696a0700e9

See more details on using hashes here.

Supported by

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