Schema could not be fetched absinthe error

I am using absinthe in the project, and I am not that well-versed with Graphql. Recently, I am getting this error in the playground and schema is not generating.

Request: POST //graphql/graphiql
** (exit) an exception was raised:
** (UndefinedFunctionError) function is undefined
    (absinthe 1.6.7) lib/absinthe/type/built_ins/introspection.ex:349: Absinthe.Type.BuiltIns.Introspection.render_default_value/4
    (elixir 1.10.4) lib/enum.ex:1396: Enum."-map/2-lists^map/1-0-"/2
    (elixir 1.10.4) lib/enum.ex:1396: Enum."-map/2-lists^map/1-0-"/2
    (absinthe 1.6.7) lib/absinthe/type/built_ins/introspection.ex:333: Absinthe.Type.BuiltIns.Introspection.render_default_value/4

If I run mix absinthe.schema.json --schema SupertrendsWeb.GraphQL.Schema, it gives the same thing and there isn’t much in the error to debug.
Could anyone please suggest how to debug this issue?

Based on that stacktrace, I’d guess there’s a misconfigured Enum someplace that’s crashing in render_default_value:

1 Like

Yeah that looks like a good theory. @script is there anywhere in your schema where you are using an enum type as a field value with a default ?

Hi @benwilson512 , thank you for your reply, yes , there are couple of enums I have been using in the code, but to exactly figure out which one was wrong was time taking, so I put inspect statements in the introspection.ex file, and figure out the exact enums I need to change, there are a couple of them, and it’s working fine now :slight_smile:

Thank you for your suggestion, indeed that was the issue. Appreciate your prompt response, :slight_smile: