Repository navigation
Formatted output, possibleTypes, type name escaping, document validation - #5
Merged
Merged
Conversation
Files are formatted for the language version of the package being built, so they pass `dart format --set-exit-if-changed` in user projects.
- types.dart exports `possibleTypes` for GraphQLCache(possibleTypes: ...) - Schema types named like identifiers the generated code uses (Map, String, Object, Future, Set, JsonKey, Decimal, ...) get a trailing underscore in Dart; __typename dispatch and possibleTypes keep the GraphQL names - Fix: non-null lists of custom scalars, DateTime, LocalDate and Decimal did not compile with strict_nullability (list helpers returned nullable lists) - Compile test covers a schema full of colliding names
Unknown fields at any depth (BLD103), unknown or missing required arguments (BLD105), undeclared, unused or wrongly typed variables (BLD106) and missing or unexpected selection sets and invalid fragment types (BLD107) are reported together, with path and line. `validate_documents: false` turns it off.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes for 2.2.0.
Added
dart_stylefor the language version of the package being built (fromBuildStep.packageConfig), sodart format --set-exit-if-changedpasses in user projectstypes.dartexportspossibleTypes(Map<String, Set<String>>) forGraphQLCache(possibleTypes: ...)BLD103, was root only), unknown or missing required arguments (BLD105), variable problems (BLD106), selection set and fragment type problems (BLD107). All problems are reported at once with path and line.validate_documents: falseturns it offFixed
Map,String,Object,Future,Set,JsonKey, object typesDecimal/Long/Byte, ...) produced code that didn't compile. They now get a trailing underscore in Dart (type Map→class Map_);__typenamedispatch andpossibleTypeskeep the GraphQL namesstrict_nullability,[CustomScalar!]!/[DateTime!]!/[Decimal!]!fields didn't compile because the list helpers returned nullable lists (found while adding the collision test)Behavior change
Dependencies
macros(SDK 3.4). Projects on older SDKs keep resolving 2.1.0. Verified locally on Dart 3.4.0 with the oldest resolvable versions (dart_style 2.3.7, build 2.4.1, build_test 2.2.2): all 144 tests pass. CI matrix moved from 3.2.0 to 3.4.0build: ^2.4.0(forpackageConfig),dart_style: ">=2.3.7 <4.0.0"(first version withlanguageVersion; works with old and new build_runner),pub_semverTests
collidevariant: a schema full of colliding names, compiled, analyzed and run. The smoke client now usesGraphQLCache(possibleTypes: possibleTypes)