Graphql-ruby: Need to restart Rails server every time when changing query_type or any other file

353 views Asked by At

I'm using graphql 1.9.21 with rails 5.2.0 application. When I make changes to the graphql query_type or any other graphql related files such as(graphql_controller, type files, etc), I need to restart the rails server everytime. Otherwise, changes do not get reflected in the response. Changes in other models etc are working fine, but only issue with the Graphql generated file.

I'm also using graphql-pundit 0.7.1 not sure if it is causing any issue.

Thank you!

1

There are 1 answers

0
Bibek Sharma On BEST ANSWER

Looks like some issue with the namespacing. Adding :: before the Types solved the problem.

class MyXyzSchema < GraphQL::Schema
  mutation(::Types::MutationType)
  query(::Types::QueryType)
  ....
  ....
end