Distelli/graphql-apigen

It seems not supoort enum

Closed this issue · 7 comments

chank commented

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

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

I use it with spring boot.

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.

Please verify this works as expected:

#29

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

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

Released as version 4.0.0.