DocumentBuilder class

Builds GraphQL query/mutation/subscription documents from schema metadata.

final builder = DocumentBuilder(schema: schema);
final doc = builder.buildQuery(
  operationName: 'GetProduct',
  fieldName: 'product',
  fields: ['id', 'name', 'price'],
  args: {'id': 'String!'},
);

Constructors

DocumentBuilder({required GraphQLSchema schema})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
schema GraphQLSchema
final

Methods

buildFragment({required String name, required String onType, required List<String> fields}) String
Build a fragment definition.
buildMutation({required String operationName, required String fieldName, required List<String> fields, required Map<String, String> inputVars}) String
Build a mutation document string.
buildQuery({required String operationName, required String fieldName, required List<String> fields, Map<String, String>? args, List<String>? fragments}) String
Build a query document string.
buildSubscription({required String operationName, required String fieldName, required List<String> fields, Map<String, String>? args}) String
Build a subscription document string.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited