nhost_graphql_adapter
4.1.0, released 7 days ago by nhost.io
Adapter that connects the graphql package to an Nhost.io GraphQL backend
What it does
It provides a thin wrapper around the graphql client, preconfiguring links and headers for Nhost services. The package handles authentication tokens and endpoint URLs automatically, so you can start issuing queries and mutations right away.
AI-written summary of version 4.0.10, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to talk to an Nhost GraphQL backend in a Dart or Flutter app
- You already use the graphql package and want minimal boilerplate for Nhost
Skip it when
- You are using a different GraphQL client such as graphql_flutter or a custom HTTP client
- You need advanced GraphQL features not exposed by the adapter
Strengths
- Zero configuration beyond adding the dependency
- Automatic handling of auth tokens and endpoint URLs
- Works on all supported platforms
Weaknesses
- Only supports Nhost backends
- No code generation or schema introspection support
- Limited to the graphql package API
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 5
Add `nhost_graphql_adapter: ^4.0.10` to pubspec.yaml and import the package. No build_runner or permissions required.
```dart
import 'package:nhost_graphql_adapter/nhost_graphql_adapter.dart';
final client = NhostGraphQLAdapter();
final result = await client.query(
QueryOptions(document: gql('query { hello }')),
);
print(result.data);
```Alternatives
Packages that do the same job and could replace nhost_graphql_adapter.
- ferry
A GraphQL client for Dart and Flutter with code generation and normalized caching.
74Compare - graphql_codegen
Generate Dart serializers and client helpers from GraphQL queries and schemas.
78Compare - ferry_flutter
Flutter widgets for executing GraphQL operations using the ferry client
62Compare - graphql_flutter
A GraphQL client for Flutter with widget wrappers and hooks.
76Compare
Works with
Packages commonly used together with nhost_graphql_adapter: ones it builds on, ones built on it, and its own family.
- graphqlnhost_graphql_adapter depends on itA Dart GraphQL client offering queries, mutations, subscriptions and cache management.
- nhost_sdknhost_graphql_adapter depends on itDart SDK for Nhost authentication and file storage APIs.
- nhost_flutter_authSame familyProvides Nhost authentication state to your Flutter app.
- nhost_dartBuilt on nhost_graphql_adapterDart and Flutter client for Nhost Auth, Storage, Functions, and GraphQL.