gql-dart / ferry

Stream-based strongly typed GraphQL client for Dart
https://ferrygraphql.com/
MIT License
593 stars 113 forks source link

schema.schema.gql.dart not generated - "possibleTypesMap" missing #594

Open simplenotezy opened 3 months ago

simplenotezy commented 3 months ago

I am following the example repos, but with my own GraphQL endpoint. I notice that when I run: get-graphql-schema http://localhost:8787 > lib/common/domain/schema.graphql

And then then buildrunner: dart run build_runner build --delete-conflicting-outputs, it generates all files, except the schema.schema.gql.dart file:

image

(it even creates the schema.schema.gql.g.dart file?)

What am I missing here?

knaeckeKami commented 3 months ago

There's an old bug that occurs when a schema has no inputs, no enums and no scalars which causes this - does your schema maybe look like this?

simplenotezy commented 3 months ago

Yes, that was the case @knaeckeKami thanks! It started working suddenly once I started evolving the defined schema. Thanks

adamhb123 commented 1 month ago

I'm having this issue as well now - it only happens after adding a JsonSerializer for the JSON scalar type. Currently, I am just setting possibleTypesMap to an empty map ( {} ). Is this an appropriate solution? I'm not quite sure what it is used for but my queries seem to work just fine without it.