happiness (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) (^_^) happiness

graphql-ruby: unexpected field owner for "xxx": nil (NilClass)の直し方

     ArgumentError:
       unexpected field owner for "posts": nil (NilClass)

graphql-rubyで 新しいqueryをrootに追加したらこのエラーが出た。

module Types
  class QueryType < Types::Base::Object
        field :posts, Types::PostType.connection_type, null: false
  end
end

原因

PostTypeに含まれているImageTypeをgit stashしていたため。

教訓

  • git commit 忘れない
  • なんかエラーでたら型がないことを疑う