Skip to content

TypeError: Cannot read property 'types' of undefined on tutorial https://www.howtographql.com/graphql-ruby/7-filtering/Β #39

@mazelka

Description

@mazelka

I've following steps in tutorial page https://www.howtographql.com/graphql-ruby/7-filtering/ and after changing field :all_links, resolver: Resolvers::LinksSearch in query_type.rb got an error

TypeError: Cannot read property 'types' of undefined
    at buildClientSchema (http://localhost:3000/assets/graphiql/rails/application.debug-3aff84d172cfc9d5cfec9289f9417ad7ee0ecdb1e7414d33c11cac078d02875e.js:34100:72)
    at http://localhost:3000/assets/graphiql/rails/application.debug-3aff84d172cfc9d5cfec9289f9417ad7ee0ecdb1e7414d33c11cac078d02875e.js:2793:55

I've spent some time and found that issue is in link_search.rb file.

After changing line type types[Types::LinkType] to type [Types::LinkType] (according to readme in https://github.com/rstankov/SearchObjectGraphQL) everything started working fine.

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