preetjdp / YouOweMe

Making it simpler to track those chillars
9 stars 6 forks source link

[NEW IDEA] GraphQL Type Generation #7

Closed preetjdp closed 4 years ago

preetjdp commented 4 years ago

Is your feature request related to a problem? Please describe. The current way getting things from the GraphQL api is pretty a

Describe the idea / solution you'd like The solution is to explore ways to generate (/ or manually write) Classes with proper types.

The current idea is to try out Artemis and come up with a robust solution.

preetjdp commented 4 years ago

This may also be a possible candidate for the code gen process. https://pub.dev/packages/dart_graphql

preetjdp commented 4 years ago

This is how a Owe currently looks under the graphql

type Owe {
id: ID!
title: String!
amount: Float!
issuedBy: User!
issuedTo: User!
created: Timestamp!
}
preetjdp commented 4 years ago

The Implementation made with https://github.com/preetjdp/YouOweMe/commit/9b6f6dc472845938ba4b51e78c335a251d438261 does seem work. Although there are a couple of tweaks / and problems.

  1. The naming schema of the generated type is outright bad.

Seva$Query$User <== How is this a good class name?

  1. Issues with Custom Scalar? https://github.com/preetjdp/YouOweMe/issues/9
  2. Issues with Subscription ? https://github.com/comigor/artemis/issues/76
preetjdp commented 4 years ago

Things seem to be working pretty nicely after using this. https://github.com/comigor/artemis/issues/99#issuecomment-594739281