graphql_schema_annotation 0.1.1
graphql_schema_annotation: ^0.1.1 copied to clipboard
Annotations read by graphql_schema_generator: GraphQL directives, interfaces and scalars, declared on the plain Dart classes the schema is generated from.
0.1.1 #
- Lowers the Dart floor to 3.3, from 3.8, and accepts
metafrom 1.16.0, the last version that carries no Dart floor of its own above 3.0. The annotations use nothing newer than 3.3, and what sets the floor now is theextension typein the example rather than a constraint nothing needed. - No change to the annotations themselves.
0.1.0 #
First release.
@GraphQLDirectivedeclares the class it is placed on as a GraphQL directive.name:is what the schema calls it,on:lists the locations it may be applied at, andrepeatable:allows it more than once at one place.- The fields of a directive class are the arguments of the directive. An instance of the class applies it, and the values that instance was built with become the values of the arguments. Dart allows such an annotation on a class, a field, a getter, a method, a parameter, an enum and one of its constants.
@GraphQLScalarcarries a type into the schema under a scalar name, which is how anextension typereachesID.specifiedByUrl:adds@specifiedByto the declaration of a scalar the specification does not define.@GraphQLSkipkeeps a member out of the schema, and follows it when it is renamed.@GraphQLInterfacepublishes an abstract class reached throughextendsas a GraphQL interface. One reached throughimplementsis already one and needs no annotation.DirectiveLocationholds the 19 locations the GraphQL specification defines. Eight of them describe a query document rather than a schema. A directive can declare those, and nothing in Dart can apply them.- Every annotation carries
@Target, so writing one where it has no meaning is reported by the analyser and failsdart analyze, before the generator runs.