angel-dart / angel

[ARCHIVED] A polished, production-ready backend framework in Dart for the VM, AOT, and Flutter.
https://angel-dart.dev/
MIT License
1.06k stars 67 forks source link

Q: How to define new GraphQL scalar types? #240

Closed nlfiedler closed 3 years ago

nlfiedler commented 4 years ago

I would like to define a "BigInt" scalar type in GraphQL, but quite a few of the methods in the base classes are private, so I am unable to do this. Maybe I am missing something? As an example, the ValidationResult cannot be implemented outside of the graphql_schema package because of private methods.

thosakwe commented 4 years ago

Admittedly, making the ValidationResult fields private was a fatal design flaw. I will try to put out a patch for it tonight.

In the meantime, the following example shows how to override it (though the true solution is to make the ValidationResult fields public): https://github.com/angel-dart/angel/blob/master/packages/graphql/angel_graphql/lib/angel_graphql.dart#L40-L46

nlfiedler commented 4 years ago

Terrific, thanks!