Coder Social home page Coder Social logo

Comments (3)

danielmahon avatar danielmahon commented on June 27, 2024

adding the missing import MyModel into serializers.gql.dart fixes the issue, but I still haven't dug deep enough into built_value to see why/where it's adding those builder factories, and why it's only doing it for the list item and not the other overrides

from gql.

smkhalsa avatar smkhalsa commented on June 27, 2024

@danielmahon built_value generates the serializers.gql.g.dart file based on the contents of your serializers.gql.dart.

I don't actually think this has anything to do with the custom serializer. built_value is building the BuilderFactories because one of your GraphQL operations uses a BuiltList<MyModel>, and BuilderFactories are what tell built_value how to serialize BuiltLists of non-standard types.

The easiest solution would be to just include an import of any type overrides by default. I've created PR #148 which implements this. Can you please confirm that it fixes the issue? NOTE: you will need to include your type_overrides map in the serializer_builder in your build.yaml file.

A more elegant solution that selectively imports the custom types only when they will be used in a BuilderFactory would not be trivial, and I think this solution is probably good enough.

from gql.

danielmahon avatar danielmahon commented on June 27, 2024

@smkhalsa this works, thank you

from gql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.