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.0.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.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for llama_index_readers_graphql-0.4.0.tar.gz
Algorithm Hash digest
SHA256 5e8b7a4f9e67681fa6364d12ab85592509ecc24893f249c27757b6190e09f0f8
MD5 7f6d5766f3379b8328509c538b9523fa
BLAKE2b-256 925a362fdea7e9b35d98d861b2ed3f410f24bb50606f19531544111677c6572c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_readers_graphql-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b599f6235fcf4d4fda9526a6f5f290aa930eb4579ccf99d8a816e11aa06cb05c
MD5 124872c03a6d016e80c704cbc74de4df
BLAKE2b-256 f67b379de562db9e630f0248bba92da7ea9f94e47115b42d84388386a290d34b

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