Bump server -> beta.3
This commit is contained in:
parent
9b92aada66
commit
75556461d0
3 changed files with 27 additions and 2 deletions
|
@ -74,3 +74,23 @@ await server.done;
|
|||
|
||||
See `graphQLWS` in `package:angel_graphql` for a good example:
|
||||
https://github.com/angel-dart/graphql/blob/master/angel_graphql/lib/src/graphql_ws.dart
|
||||
|
||||
## Introspection
|
||||
Introspection of a GraphQL schema allows clients to query the schema itself,
|
||||
and get information about the response the server expects. The `GraphQL`
|
||||
class handles this automatically, so you don't have to write any code for it.
|
||||
|
||||
However, you can call the `reflectSchema` method to manually reflect a schema:
|
||||
https://pub.dartlang.org/documentation/graphql_server/latest/introspection/reflectSchema.html
|
||||
|
||||
## Mirrors Usage
|
||||
By default, `dart:mirrors` is not required, but it can be optionally used.
|
||||
|
||||
The `mirrorsFieldResolver` can resolve fields from concrete objects, instead of you
|
||||
first having to serialize them:
|
||||
https://pub.dartlang.org/documentation/graphql_server/latest/graphql_server.mirrors/mirrorsFieldResolver.html
|
||||
|
||||
You can also use `convertDartType` to convert a concrete Dart type into a `GraphQLType`. However,
|
||||
the ideal choice is `package:graphql_generator`.
|
||||
* https://pub.dartlang.org/documentation/graphql_server/latest/graphql_server.mirrors/convertDartType.html
|
||||
* https://pub.dartlang.org/packages/graphql_generator
|
|
@ -1,6 +1,11 @@
|
|||
import 'package:graphql_parser/graphql_parser.dart';
|
||||
import 'package:graphql_schema/graphql_schema.dart';
|
||||
|
||||
/// Performs introspection over a GraphQL [schema], and returns a new one, containing
|
||||
/// introspective information.
|
||||
///
|
||||
/// [allTypes] should contain all types, not directly defined in the schema, that you
|
||||
/// would like to have introspection available for.
|
||||
GraphQLSchema reflectSchema(GraphQLSchema schema, List<GraphQLType> allTypes) {
|
||||
for (var type in allTypes.toList()) {
|
||||
var custom = _fetchAllTypesFromType(type);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
name: graphql_server
|
||||
version: 1.0.0-beta.2
|
||||
version: 1.0.0-beta.3
|
||||
author: Tobe O <thosakwe@gmail.com>
|
||||
description: Base package for implementing GraphQL servers. You might prefer `package:angel_graphql`, the fastest way to implement GraphQL backends in Dart.
|
||||
homepage: https://github.com/angel-dart/graphql
|
||||
|
|
Loading…
Reference in a new issue