graphql_generator 1.0.0-rc.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new50

graphql_generator #

Pub build status

Generates package:graphql_schema schemas for annotated class.

Replaces convertDartType from package:graphql_server.

Usage #

Usage is very simple. You just need a @graphQLClass or @GraphQLClass() annotation on any class you want to generate an object type for.

Individual fields can have a @GraphQLDocumentation() annotation, to provide information like descriptions, deprecation reasons, etc.

@graphQLClass
class Todo {
  String text;

  @GraphQLDocumentation(description: 'Whether this item is complete.')
  bool isComplete;
}

void main() {
  print(todoGraphQLType.fields.map((f) => f.name));
}

The following is generated (as of April 18th, 2019):

// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'main.dart';

// **************************************************************************
// _GraphQLGenerator
// **************************************************************************

/// Auto-generated from [Todo].
final GraphQLObjectType todoGraphQLType = objectType('Todo',
    isInterface: false,
    interfaces: [],
    fields: [
      field('text', graphQLString),
      field('isComplete', graphQLBoolean)
    ]);

1.0.0-rc.1 #

  • Add CHANGELOG.md, example/main.dart.
  • Add documentation to README.md.

example/main.dart

import 'package:graphql_schema/graphql_schema.dart';
part 'main.g.dart';

@graphQLClass
class Todo {
  String text;

  @GraphQLDocumentation(description: 'Whether this item is complete.')
  bool isComplete;
}

void main() {
  print(todoGraphQLType.fields.map((f) => f.name));
}

Use this package as a library

1. Depend on it

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


dependencies:
  graphql_generator: ^1.0.0-rc.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support 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_generator/graphql_generator.dart';
  
Version Uploaded Documentation Archive
1.0.0-rc.1 Apr 18, 2019 Go to the documentation of graphql_generator 1.0.0-rc.1 Download graphql_generator 1.0.0-rc.1 archive
1.0.0-rc.0 Apr 16, 2019 Go to the documentation of graphql_generator 1.0.0-rc.0 Download graphql_generator 1.0.0-rc.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
2
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
95
Overall:
Weighted score of the above. [more]
50
Learn more about scoring.

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

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: other

Primary library: package:graphql_generator/graphql_generator.dart with components: io, build, mirrors.

Maintenance suggestions

Package is pre-release. (-5 points)

Pre-release versions should be used with caution; their API can change in breaking ways.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
analyzer >=0.27.1 <2.0.0 0.36.0
angel_model ^1.0.0 1.0.2
angel_serialize_generator ^2.0.0 2.4.3
build ^1.0.0 1.1.3
build_config ^0.3.0 0.3.2
code_builder ^3.0.0 3.2.0
graphql_schema ^1.0.2 1.0.4
recase ^2.0.0 2.0.1
source_gen ^0.9.4 0.9.4+2
Transitive dependencies
angel_serialize 2.2.3+1
args 1.5.1
async 2.2.0
built_collection 4.2.0
built_value 6.4.0
charcode 1.1.2
code_buffer 1.0.1
collection 1.14.11
convert 2.1.1
crypto 2.0.6
dart_style 1.2.7
fixnum 0.10.9
front_end 0.1.15
glob 1.1.7
json_annotation 2.2.0
kernel 0.3.15
logging 0.11.3+2
matcher 0.12.5
meta 1.1.7
package_config 1.0.5
path 1.6.2
pedantic 1.5.0
pub_semver 1.4.2
pubspec_parse 0.1.4
quiver 2.0.3
quiver_hashcode 2.0.0
source_span 1.5.5
stack_trace 1.9.3
string_scanner 1.0.4
term_glyph 1.1.0
typed_data 1.1.6
watcher 0.9.7+10
yaml 2.1.15
Dev dependencies
build_runner ^1.0.0