Add graphql root types
This commit is contained in:
parent
52e84f2ffe
commit
e06051bc96
3 changed files with 34 additions and 0 deletions
|
@ -3,6 +3,9 @@ class Api::V2::Schema < GraphQL::Schema
|
|||
max_complexity 300
|
||||
max_depth 15
|
||||
|
||||
query Types::QueryType
|
||||
mutation Types::MutationType
|
||||
|
||||
def self.unauthorized_object(error)
|
||||
# Add a top-level error to the response instead of returning nil:
|
||||
raise GraphQL::ExecutionError.new("An object of type #{error.type.graphql_name} was hidden due to permissions", extensions: { code: :unauthorized })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue