Repository navigation
Merged
Conversation
…ing, shared packages)
The <op>QueryOptions functions take graphql's onComplete/onError callbacks, which graphql_flutter's Query widget and useQuery hook call. Options parameters are now described structurally so other generators can forward them.
With a group, an operation file records it in its header, imports the group file and adds its client methods to the group class through an extension delegating to the GraphQLClient extension.
Operations of the documents in one directory are grouped (client.users.getUser()); group files are exported by index.dart, deleted when their group has no operations left, and checked for names clashing with other files (BLD108).
Fragments declared by another package (fragment_imports) are passed with the URI of their library: operation classes and local fragments implement their interfaces and import that library, and fragments.dart declares local fragments only. With types_import, generated files import that types.dart.
types_import: no types.dart is written (one generated earlier is removed); index.dart exports the shared types. fragment_imports: the fragments of the other package are read through the build step from its lib/ (files listed via the package config), checked for name clashes with local fragments and declarations, and index.dart exports their library. schema_url may be a package: URI, read through the build step.
Without grouping, operation files are skipped entirely; only group files of earlier builds are looked for.
flutter_widgets: <Op>Query, <Op>Mutation and <Op>Subscription widgets wrapping graphql_flutter's Query/Mutation/Subscription (or the *OnClient variants with an explicit client), built on the typed options, so result.parsedData is typed. Mutations run through a typed Run<Op>Mutation function taking the variables class. flutter_hooks: use<Op>Query, use<Op>WatchQuery, use<Op>Mutation (a record of a typed runMutation and the result) and use<Op>Subscription on graphql_flutter's hooks. A trailing operation kind is not repeated (GetUserQuery -> GetUserQuery). A widget named like a schema type is reported as BLD108.
Generates both result type modes into a temporary Flutter package with graphql_flutter and flutter_hooks, requires a clean flutter analyze for lib/ and runs widget tests that pump every widget and hook with a GraphQLClient on a fake link. Tagged compile and flutter; skipped when flutter is not on PATH.
# Conflicts: # lib/src/client_extension_generator.dart
# Conflicts: # lib/src/client_extension_generator.dart
# Conflicts: # lib/src/client_extension_generator.dart
# Conflicts: # lib/src/client_extension_generator.dart # lib/src/type_generator.dart
Flutter widgets and hooks, explicit nulls for inputs and variables, the enums option, Relay nodes getters, operation groups and several packages, with options and error table rows. Also: variable defaults as of 3.0.1, selecting id for the normalized cache, and the license link pointing to master.
Input copyWith(x: null) and fromJson now keep explicit nulls, and variables compare by value.
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.
Release 3.1.0. All new options are off by default.
flutter_widgets/flutter_hooks: typed graphql_flutter widgets (<Op>Query,<Op>Mutation,<Op>Subscription) and hooks (use<Op>Query,use<Op>WatchQuery,use<Op>Mutation,use<Op>Subscription)X.withNulls(...)andcopyWith(x: null)on input and variables classes; variables classes get==/hashCodeandcopyWithenums: map a GraphQL enum to your own type, or set a per-enumfallbacknodesgetter on Relay-styleedges { node }connections (result and fragment data classes)group_operations: directory:client.<group>.<operation>()types_import,fragment_imports,package:schema URLs<op>QueryOptionstakesonComplete/onErrorBehaviour changes (input
copyWith(x: null), inputfromJsonnulls, variables equality) are listed in CHANGELOG.md and MIGRATION.md.