Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Error nil.type/0 is undefined is hard to diagnose #105

Open
@joshprice

Description

@joshprice

As reported by @puruzio on Slack. The stacktrace from this error makes it very hard to pin down where the error is occurring in the schema.

Ideally this error should be pre-empted with a useful warning to avoid the problem.

 ** (UndefinedFunctionError) function nil.type/0 is undefined or private                                                                                                                        
    nil.type()                                                                                                                                                                                 
    (elixir) lib/enum.ex:1188: anonymous fn/3 in Enum.map/2                                                                                                                                    
    (stdlib) lists.erl:1263: :lists.foldl/3                                                                                                                                                    
    (elixir) lib/enum.ex:1188: Enum.map/2                                                                                                                                                      
    lib/graphql/type/schema.ex:111: GraphQL.Schema._reduce_arguments/2                                                                                                                         
    lib/graphql/type/schema.ex:76: anonymous fn/2 in GraphQL.Schema.reduce_types/2                                                                                                             
    (stdlib) lists.erl:1263: :lists.foldl/3                                                                                                                                                    
    lib/graphql/type/schema.ex:75: GraphQL.Schema.reduce_types/2                                                                                                                               
    (stdlib) lists.erl:1263: :lists.foldl/3                                                                                                                                                    
    lib/graphql/type/schema.ex:75: GraphQL.Schema.reduce_types/2                                                                                                                               
    lib/graphql/type/schema.ex:49: GraphQL.Schema.do_reduce_types/2                                                                                                                            
    lib/graphql/type/schema.ex:30: GraphQL.Schema.new/1                                                                                                                                        
    lib/graphql/validation/validator.ex:58: GraphQL.Validation.Validator.validate_with_rules/3                                                                                                 
    lib/graphql.ex:103: GraphQL.execute_with_optional_validation/3                                                                                                                             
    lib/graphql_relay.ex:22: GraphQL.Relay.introspection/0                                                                                                                                     
    lib/graphql_relay.ex:17: GraphQL.Relay.generate_schema_json!/0                                                                                                                             
    (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6                                                                                                                                            
    (elixir) lib/code.ex:168: Code.eval_string/3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions