brick_graphql 3.1.0
brick_graphql: ^3.1.0 copied to clipboard
GraphQL connector for Brick, a data persistence library. Includes annotations, adapter, model, and provider.
Unreleased #
3.1.0 #
- Apply standardized lints
- Upgrade minimum Dart to 2.18
3.0.1 #
- Support Dart 3
3.0.0 #
Please follow the v3 migration guide to easily upgrade.
- BREAKING CHANGE Rename
graphql.darttobrick_graphql.dart - Use Dart 2.15's
.byNameaccessor for iterable enum values and removeGraphqlAdapter.enumValueFromNameandGraphqlAdapter.firstWhereOrNull. Instead use<Enum>.values.byNameandimport 'package:collection/collection.dart''s.firstWhereOrNullrespectively. - BREAKING CHANGE consolidate
providerArgs['document']andproviderArgs['variables']toproviderArgs['operation'].providerArgs['operation']should be aGraphqlOperationwhich can be constructed with adocumentandvariables
2.0.2 #
- Remove
operationName. This isn't exactly what it appears to be.
2.0.1 #
- Include
operationNamewhen programmatically generating operations
2.0.0 #
- BREAKING CHANGE
GraphqlProvider#queryToVariableshas been moved to internal classGraphqlRequest - Update minimum Dart to
2.15
BREAKING CHANGE
All Graphql operations are now declared in a single class - GraphqlQueryOperationTransformer. A single Migration guide:
- Create a new class that extends
GraphqlQueryOperationTransformer:class UserQueryOperationTransformer extends GraphqlQueryOperationTransformer { const UserQueryOperationTransformer(super.query, super.instance); } - This class has access to every request's
query, and fordeleteandupsert,instance. Move all declared properties to within one ofget,delete,subscribeorupsert.defaultSubscriptionFilteredOperationanddefaultSubscriptionOperationare nowsubscribe. Additionally,defaultQueryFilteredOperationanddefaultQueryFilteredOperationhave been consolidated toget(example below)class UserQueryOperationTransformer extends GraphqlQueryOperationTransformer { GraphqlOperation get get { if (query.where != null) { return GraphqlOperation(document: r''' query FilteredUsers($name: String!) { usersByName(input: $input) {} } '''); } return GraphqlOperation(document: r''' query AllUsers { users {} } '''); } } - In complex cases where the entire model is not being transmitted,
variablescan also be supplied.class UserQueryOperationTransformer extends GraphqlQueryOperationTransformer { GraphqlOperation get upsert { if (query.where != null) { return GraphqlOperation( document: r''' mutation UpdateUserName($name: String!) { updateUserName(input: $input) {} } ''', variables: {'name': Where.firstByField('name', query.where)}); } return null; } } - Use the class in
GraphqlSerializable(this replaces all operation declarations):@GraphqlSerializable( queryOperationTransformer: UserQueryOperationTransformer.new )
1.3.1 #
- Only return
getdocuments forgetoperations when constructing the GraphQL document
1.3.0 #
- Convert
@Graphql(subfields:)to accept aMap<String, Map<String, dynamic>>to permit nested subfields from JSON-encoded field types.
1.2.0 #
- Handle edge case where GraphQL response is null and an empty iterable
- Use specified
@Graphql(name:)when generating the document request
1.1.2 #
- Override
subfieldsgeneration by supplying the necessary subfields with@Graphql
1.1.1 #
- Loosen
gql,gql_exec, andgql_linkrestriction
1.1.0 #
- If a document is declared without subfields, do not overwrite this definition with subfields from the model.
- Add
variablesNamespaceto wrap all variables from all requests. Variables passed fromproviderArgswill not be wrapped within the namespace.
1.0.3 #
- Return
nullif no GraphQL document can be inferred inModelFieldsDocumentTransformerinstead of throwing anArgumentError. This mirrors behavior inbrick_rest.
1.0.2 #
- Add
subfieldstoRuntimeGraphqlDefinition; supportsubfieldsinModelFieldsDocumentTransformer - When a field's type declares a
toJsonmethod that returns a map, subfields will be automatically populated on fetch requests based on thefinalinstance fields of that field's type.
1.0.1 #
- Loosen dependency restrictions to major versions
- Expose
RuntimeGraphqlDefinition
1.0.0 #
- Stable release
0.0.1+4 #
- Supply
contextas<String, ContextEntry>instead of type do to a limitation in JSON serialization
0.0.1+3 #
- Support supplying
contextinQuery#providerArgs
0.0.1+2 #
- Rename
fieldsToRuntimeDefinitiontofieldsToGraphqlRuntimeDefinition
0.0.1+1 #
- Return
List<_Model>when invokingsubscribe
0.0.1 #
Alpha release