Skip to content
pubscout

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

WASM-ready
$ flutter pub add nhost_graphql_adapter
Source repository

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.

Works with

Packages commonly used together with nhost_graphql_adapter: ones it builds on, ones built on it, and its own family.