gql-dart / gql

Libraries supporting GraphQL in Dart
MIT License
267 stars 121 forks source link

Issue with - distinguishing between null and absent values #446

Open LiLatee opened 6 months ago

LiLatee commented 6 months ago

Hi! 👋 I've updated packages in order to use that https://github.com/gql-dart/gql/pull/381 cool feature, but I've encountered an issue in schema.schema.gql.dart file. I have a custom serializer CustomDateSerializer that changes Date scalar GQL type into CustomDate dart class, but in newly generated part of the code it tries to use that CustomDate class from the wrong file. It should use _i4 instead of _i2.

image image

Is there a chance that I've made some mistake on my side or should I try to find the error in the generator?

knaeckeKami commented 6 months ago

It's likely a bug in the generator - see also https://github.com/gql-dart/ferry/issues/582#issuecomment-1947214115

but i didn't have time to look into it yet - but it could be related to having multiple operations in the same file

LiLatee commented 6 months ago

Oh my mistake I haven't checked new issues. Ok, good to know. I will try to take a look at the issue on the weekend. 👌

knaeckeKami commented 6 months ago

Thanks! It almost certainly has something to do with the used Allocators - this is the class that adds the prefixes.

(i suspect not with the implementation of the GqlAllocator, as it is pretty straight forward - more with the usage)