graphiti-api / graphiti

Stylish Graph APIs
https://www.graphiti.dev/
MIT License
974 stars 139 forks source link

Is it possible to specify a dynamic base_url #393

Open mozcomp opened 2 years ago

mozcomp commented 2 years ago

We have a multi-domain app, where the base_url will change in line with the url for the request. How best to specify the base-url for the resources? Is there an option to specify a Proc?

mozcomp commented 2 years ago

Realised I can set it easily in a controller before_action

mozcomp commented 2 years ago

the issue seems to be with linked resources, you can set the base_url in the controller for the primary resource, but the linked resources retain the base_url of the domain at the time they were initialised.

Ideally it would be something like configuring a global base_url using a Proc