-
Includes
enum
shorthand,field :status, enum("PersonStatusEnum", Person.statuses.keys), null: false
-
Catches errors automatically:
ActiveRecord::RecordNotFound
-
Includes
raise_error
response handler inGraphQL::Schema::RelayClassicMutation
raise_error person.errors.full_messages.to_sentence unless person.update(status: :active)
-
Add
authorize
option tofield
# app/graphql/types/base_field.rb field_class.include(Phantom::Graphql::Authorization)
field :posts, [Types::PostType], authorize: "PostPolicy#index?", null: false