Last updated:
0 purchases
galileo graphql generator
galileo_graphql_generator #
Generates package:galileo_graphql_schema schemas for
annotated class.
Replaces convertDartType from package:galileo_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
@GraphQLDocumentation(description: 'Todo object type')
class Todo {
String text;
/// Whether this item is complete
bool isComplete;
}
void main() {
print(todoGraphQLType.fields.map((f) => f.name));
}
copied to clipboard
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,
description: 'Todo object type',
interfaces: [],
fields: [
field('text', graphQLString),
field('isComplete', graphQLBoolean, description: 'Whether this item is complete')
]);
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.