gql 0.0.2
gql: ^0.0.2 copied to clipboard
GraphQL tools for parsing, transforming and printing GraphQL documents.
A library for working with GraphQL documents.
⚠️ This library is under development ⚠️
Usage #
Simply use parse
, transform
and/or printNode
.
import 'package:gql/language.dart';
main() {
final SourceFile sourceFile = SourceFile.fromString(
"""
type Foo {
bar: Bar
baz: [Baz!]!
}
type Bar {
boo: Boo
}
""",
);
final DocumentNode document = parse(sourceFile);
final DocumentNode transformedDocument = transform(
document,
[
MyTransformer(),
MyOtherTransformer(),
],
);
final String printed = printNode(transformedDocument);
print(printed);
}
Features and bugs #
Please file feature requests and bugs at the GitHub.