micimize / graphql-to-dart

generate dart classes and respective JsonSerializable transcoders
42 stars 8 forks source link

Include documents in output #9

Closed EugenePisotsky closed 4 years ago

EugenePisotsky commented 5 years ago

Hello,

It works nice already, but would be better if output will also contain document, so there's no need to load file.

const HeroForEpisodeDoc = """query HeroForEpisode($ep: Episode!) {
  hero(episode: $ep) {
    __typename
    name
    ... on Droid {
      primaryFunction
    }
    ... on Human {
      height
      homePlanet
    }
  }
}""";
micimize commented 5 years ago

This might be doable with a graphql-code-generator plugin or something - it seems difficult and error prone to me though. I have some utilities for making file loading easier - what I'd really like to do is output the input queries as the toString on their models, or something like that.

micimize commented 4 years ago

You can now import/export gql_code_gen generated asts with the beta

Eventually the gql_code_gen will have it's own type generation, which will offer better support