Types::BaseField accepts authorize after reload

When working on files in `app/graphql` the code correctly gets
autoloaded.

However, the redefined `Types::BaseField` would never receive the
`.accepts_definition` call, causing all queries after a reload to
fail. Calling `.accepts_definition` on its superclass makes sure the
reloaded version also has the `authorize` definition specified.
This commit is contained in:
Bob Van Landuyt 2019-03-01 18:30:42 +01:00
parent 190a6a1e67
commit 58aaa766a4
1 changed files with 1 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# frozen_string_literal: true
GraphQL::Field.accepts_definitions(authorize: GraphQL::Define.assign_metadata_key(:authorize))
Types::BaseField.accepts_definition(:authorize)
GraphQL::Schema::Field.accepts_definition(:authorize)