@alevettih/ngx-graphql-client
November 25, 2025 · View on GitHub
A typed GraphQL client for Angular applications that makes it easy to work with GraphQL APIs using full TypeScript support.
Overview
@alevettih/ngx-graphql-client is an Angular library that provides a simple, type-safe way
to work with GraphQL APIs. The library relies on typed GraphQL operations and
integrates with Angular HttpClient to execute requests.
Features
- ✅ Full TypeScript support for GraphQL operations
- ✅ Support for queries, mutations, and batch operations
- ✅ Custom error handlers per request
- ✅ Automatically throws when a GraphQL response includes errors (via the built-in HTTP interceptor)
- ✅ Seamless integration with Angular HttpClient, including support for all
HttpClient.postoptions in every client method
Project Structure
ngx-graphql-client/
├── projects/
│ └── ngx-graphql-client/ # Library source code
│ └── src/
│ └── lib/
│ ├── helpers/ # Helpers and type guards
│ ├── interceptors/ # HTTP interceptors
│ ├── models/ # TypeScript models
│ ├── services/ # GraphQLClient service
│ └── types/ # TypeScript types
├── dist/ # Build artifacts
└── package.json
Development
Requirements
- Node.js 24+
- npm 11+
- Angular CLI 21+
Install Dependencies
npm install
Build the Library
npm run build
Or build in watch mode:
npm run watch
Testing
npm run test
Linting
Run lint checks:
npm run lint
Auto-fix issues:
npm run lint:fix
Formatting
Check formatting:
npm run format:check
Auto-format the code:
npm run format
Library Usage
For detailed usage guidelines, see the library README.
Tech Stack
- Angular 21+
- TypeScript 5.9+
- GraphQL 16+
- RxJS 7.8+
- es-toolkit 1.41+
- Vitest 4+ (for testing)
License
This project is distributed under the MIT license.