GraphQL constructor
GraphQL()
Implementation
GraphQL(GraphQLSchema schema,
{bool introspect = true,
this.defaultFieldResolver,
List<GraphQLType> customTypes = const <GraphQLType>[]})
: _schema = schema {
if (customTypes.isNotEmpty == true) {
this.customTypes.addAll(customTypes);
}
var allTypes = fetchAllTypes(schema, [...this.customTypes]);
if (introspect) {
_schema = reflectSchema(_schema, allTypes);
}
for (var type in allTypes.toSet()) {
if (!this.customTypes.contains(type)) {
if (type != null) {
this.customTypes.add(type);
}
}
}
if (_schema.queryType != null) {
this.customTypes.add(_schema.queryType!);
}
if (_schema.mutationType != null) {
this.customTypes.add(_schema.mutationType!);
}
if (_schema.subscriptionType != null) {
this.customTypes.add(_schema.subscriptionType!);
}
}