graphql_builder 1.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 51

Build GraphQL queries in dart.

Example #

this code:

    .add(Query(name: "test")
    .add(Fragment("frag1", TypeCondition("Cat"))

will generate this query:

query test {

fragment frag1 on Cat {

Usage #

add graphql_builder: ^1.0.0 to your dependencies

1.0.0 #

  • Initial version, created by Stagehand


import 'package:graphql_builder/graphql_builder.dart';

main() {

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  graphql_builder: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:graphql_builder/graphql_builder.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Apr 8, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Health issues and suggestions

Document public APIs. (-1 points)

221 out of 221 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/Name.dart. (-0.50 points)

Analysis of lib/src/Name.dart reported 1 hint:

line 4 col 34: Unnecessary new keyword.

Format lib/graphql_builder.dart.

Run dartfmt to format lib/graphql_builder.dart.

Format lib/src/Argument.dart.

Run dartfmt to format lib/src/Argument.dart.

Fix additional 10 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/Base.dart (Run dartfmt to format lib/src/Base.dart.)
  • lib/src/Definition/Definition.dart (Run dartfmt to format lib/src/Definition/Definition.dart.)
  • lib/src/Directive/SkipDirective.dart (Run dartfmt to format lib/src/Directive/SkipDirective.dart.)
  • lib/src/Selection/Field.dart (Run dartfmt to format lib/src/Selection/Field.dart.)
  • lib/src/Selection/InlineFragment.dart (Run dartfmt to format lib/src/Selection/InlineFragment.dart.)
  • lib/src/Selection/Selection.dart (Run dartfmt to format lib/src/Selection/Selection.dart.)
  • lib/src/Value/ConstValue/ArrayConst.dart (Run dartfmt to format lib/src/Value/ConstValue/ArrayConst.dart.)
  • lib/src/Value/ConstValue/ConstValue.dart (Run dartfmt to format lib/src/Value/ConstValue/ConstValue.dart.)
  • lib/src/Value/Value.dart (Run dartfmt to format lib/src/Value/Value.dart.)
  • lib/src/VariableType.dart (Run dartfmt to format lib/src/VariableType.dart.)

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
Dev dependencies
pedantic ^1.0.0
test ^1.0.0