Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

context_for_endpoint doesn't work if you have routing constraints #34

Open
wagenet opened this issue Jun 19, 2019 · 1 comment
Open
Labels
bug Something isn't working

Comments

@wagenet
Copy link
Collaborator

wagenet commented Jun 19, 2019

recognize_path doesn't allow for much configuration of the request which can be problematic if you have constraints in your router.

https://github.com/graphiti-api/graphiti-rails/blob/master/lib/graphiti/rails/railtie.rb#L134

@wagenet wagenet added the bug Something isn't working label Jun 19, 2019
@wagenet
Copy link
Collaborator Author

wagenet commented Jun 19, 2019

In my scenario the constraint was on the host, so I fixed it with:

original = Graphiti.config.context_for_endpoint
Graphiti.config.context_for_endpoint = lambda do |path, action|
  original.call(DEFAULT_HOST + path.to_s, action)
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant