Closed alexeyinkin closed 1 day ago
Thanks!
You're right, this should be fixed, probably the serializers should move to another package.
For now, as a workaround, I suggest adding gql_code_builder as a direct dependency instead of the entirety of ferry_generator.
please check out ferry_generator 0.12.0-dev.1 note that you need to add gql_code_builder_serializers, which a package that just contains the common serializers that the code generation assumes exist
I have the following in my generated serializers.gql.dart:
This ends up imported into non-dev code that is used when making the actual GraphQL calls, but
gql_code_builder
is a dependency offerry_generator
which is a dev-dependency of the end-code according to the docs: https://ferrygraphql.com/docs/setupThis is not a problem when
ferry_generator
is directly included into pubspec.yaml of an app because dev dependencies are still pulled there.However, when using
ferry_generator
as a dev-dependency in a package, it's not pulled into an end-app because dev-dependencies are not pulled recursively.This breaks the build for me with this error despite all
pub get
run successfully:The workaround is simple:
ferry_generator
should be included as a non-dev dependency of the package. However, this brings redundant dependencies and breaks a lot of the original ideas (like the idea to separateferry
andferry_generator
in the first place).