RedHatInsights / insights-api-common-rails

Header, Encryption, RBAC, Serialization, Pagination and other common behavior for Insights microservices built with Rails
Apache License 2.0
3 stars 25 forks source link

Allow to load GraphQL erb templates outside of repo #221

Closed lpichler closed 3 years ago

lpichler commented 3 years ago

This allows to make GraphQL erb(model_type.erb, query_type.erb, schema.erb) templates configurable in repo(For example in sources-api) where is insights-api-common-rails gem used and templates live in location ./api/common/graphql/templates in remote repos.

Example: So if you want override GraphQL schema for source-api, you need to create file in source-api repo like is this PR.

Links

Together with TOPO PR and Sources PR fixes: https://issues.redhat.com/browse/RHCLOUD-11179 and disables GraphQL introspection in source/topo APIs.

dippy-bot commented 3 years ago

Checked commits https://github.com/lpichler/manageiq-api-common/compare/5b87eaa975dc3067ebf86e30c94132c0f6dcac3f~...088b5c0d8f142c98600c4b9092eca013eaa9c60c with ruby 2.5.7, rubocop 0.82.0, haml-lint 0.35.0, and yamllint 2 files checked, 0 offenses detected Everything looks fine. :cake:

lpichler commented 3 years ago

Would we want a spec ( or maybe we have on in the API repos ) that proves introspection doesn't work when the disable_introspection_entry_points config value is set?

yes, that's right and now I added also this case to specs, thanks @syncrou!