GraphQL Agent Tool
A powerful LangChain tool that enables LLM models and AI agents to autonomously execute GraphQL queries and mutations. This package allows AI agents to intelligently interact with GraphQL APIs, making decisions about when and how to fetch or modify data through GraphQL endpoints without explicit human intervention.

Features
- ๐ค Autonomous GraphQL operation execution by AI agents
- ๐ Intelligent query/mutation selection based on agent's needs
- ๐ ๏ธ Type-safe implementation with TypeScript
- ๐ Seamless integration with LangChain/Langgraph/LLM Models
- ๐ฏ Customizable response parsing for agent consumption
- ๐ Secure configuration options
- ๐ Comprehensive documentation
- ๐งช Test coverage - 100%
Installation
npm install graphql-agent-tool
yarn add graphql-agent-tool
pnpm add graphql-agent-tool
Prerequisites
- Node.js >= 20.0.0
- TypeScript >= 5.0.4 (optional but recommended)
Documentation
For detailed documentation and examples, please refer to our guides:
Development
Setup
- Clone the repository
- Install dependencies:
pnpm install
Available Scripts
pnpm build
- Build the package
pnpm test
- Run tests
pnpm test:watch
- Run tests in watch mode
pnpm test:coverage
- Run tests with coverage
pnpm lint
- Run linter
pnpm format
- Format code
pnpm typecheck
- Type check the codebase
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Sohab Sk - GitHub
Acknowledgments
- LangChain for the amazing framework
- Axios for the HTTP client
- Zod for runtime type checking