Exception: Graphiti::Errors::InvalidEndpoint
- Defined in:
- lib/graphiti/errors.rb
Instance Method Summary collapse
-
#initialize(resource_class, path, action) ⇒ InvalidEndpoint
constructor
A new instance of InvalidEndpoint.
- #message ⇒ Object
Constructor Details
#initialize(resource_class, path, action) ⇒ InvalidEndpoint
Returns a new instance of InvalidEndpoint.
449 450 451 452 453 |
# File 'lib/graphiti/errors.rb', line 449 def initialize(resource_class, path, action) @resource_class = resource_class @path = path @action = action end |
Instance Method Details
#message ⇒ Object
455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 |
# File 'lib/graphiti/errors.rb', line 455 def <<-MSG #{@resource_class.name} cannot be called directly from endpoint #{@path}##{@action}! Either set a primary endpoint for this resource: primary_endpoint '/my/url', [:index, :show, :create] Or whitelist a secondary endpoint: secondary_endpoint '/my_url', [:index, :update] Or disable endpoint validation for this resource: self.validate_endpoints = false See https://www.graphiti.dev/guides/concepts/links for more information. The current endpoints allowed for this resource are: #{@resource_class.endpoints.inspect} MSG end |