Distelli / graphql-apigen

Generate Java APIs with GraphQL Schemas
Apache License 2.0
66 stars 20 forks source link

It seems not supoort enum #26

Closed chank closed 5 years ago

chank commented 6 years ago

I defined the following schema:

enum VerificationEnum {
  PHONE
  EMAIL
}

type VerificationPayload {
  verificationType: VerificationEnum
}

I used it with spring, but it failed with the following Exception: Caused by: graphql.GraphQLException. type VerificationEnum not found in schema

brimworks commented 6 years ago

Can you provide more information? Perhaps an easy way to reproduce the problem? enums work in our unit tests:

https://github.com/Distelli/graphql-apigen/blob/master/apigen/src/test/projects/starwars/schema/starwars.graphql

Thanks, -Brian

chank commented 6 years ago

I use it with spring boot.

chank commented 6 years ago

This is a demo project.

https://bitbucket.org/chankflq/spring-graphql-apigen-demo

gdelafosse commented 6 years ago

Hello, I reproduce too. It seems that the generator doesn't create a TypeResolver for the Enum. Your unit test only tests that the generation is successful and actually this error is visibile only at runtime.

brimworks commented 6 years ago

Please verify this works as expected:

https://github.com/Distelli/graphql-apigen/pull/29

...the unit test makes it appear that this is fixed.

seetharamani commented 5 years ago

@brimworks I verified this fix and it works fine. Thank you!

brimworks commented 5 years ago

Released as version 4.0.0.