Exception: GraphQL::Authorization::InaccessibleFieldsError

Inherits:
GraphQL::AnalysisError show all
Defined in:
lib/graphql/authorization.rb

Instance Attribute Summary collapse

Attributes inherited from ExecutionError

#ast_node, #extensions, #options, #path

Instance Method Summary collapse

Methods inherited from ExecutionError

#to_h

Constructor Details

#initialize(fields:, irep_nodes:, context:) ⇒ InaccessibleFieldsError

Returns a new instance of InaccessibleFieldsError.



15
16
17
18
19
20
# File 'lib/graphql/authorization.rb', line 15

def initialize(fields:, irep_nodes:, context:)
  @fields = fields
  @irep_nodes = irep_nodes
  @context = context
  super("Some fields in this query are not accessible: #{fields.map(&:graphql_name).join(", ")}")
end

Instance Attribute Details

#contextGraphQL::Query::Context (readonly)

Returns The current query's context.

Returns:



9
10
11
# File 'lib/graphql/authorization.rb', line 9

def context
  @context
end

#fieldsArray<Schema::Field, GraphQL::Field> (readonly)

Returns Fields that failed .accessible? checks.

Returns:



6
7
8
# File 'lib/graphql/authorization.rb', line 6

def fields
  @fields
end

#irep_nodesArray<GraphQL::InternalRepresentation::Node> (readonly)

Returns The visited nodes that failed .accessible? checks.

Returns:

See Also:

  • for the Field definitions


13
14
15
# File 'lib/graphql/authorization.rb', line 13

def irep_nodes
  @irep_nodes
end