Allow setting rest and graphQL flags and GraphQL path from CLI#1309
Conversation
…hql_runtime_flags
|
We can instead use
In my opinion, we should remain consistent with following the pattern of <--option-name> <--option-value> in CLI. To me as a user, it would be a bit confusing. |
That is definitely a way but it's not convenient in my opinion. even the |
…hql_runtime_flags
…hql_runtime_flags
…hql_runtime_flags
…hql_runtime_flags
…_flags' of https://github.com/Azure/data-api-builder into dev/abhishekkuma/allow_setting_rest_and_graphql_runtime_flags
…hql_runtime_flags
…_flags' of https://github.com/Azure/data-api-builder into dev/abhishekkuma/allow_setting_rest_and_graphql_runtime_flags
I think what Shyam was trying to say is we need to inform SWA CLI team of this new capability of being able to customize graphql path too in case they would like it to expose to their customers. |
Aniruddh25
left a comment
There was a problem hiding this comment.
LGTM! Thanks for making CLI consistent with engine and fixing the gaps
…hql_runtime_flags
…_flags' of https://github.com/Azure/data-api-builder into dev/abhishekkuma/allow_setting_rest_and_graphql_runtime_flags
… dev/abhishekkuma/allow_setting_rest_and_graphql_runtime_flags
## Why make this change? - Closes #1276, #1310 - To allow users to disable rest and graphQL endpoints globally using CLI - To allow users to provide custom graphQL path through CLI. ## What is this change? - adding 3 new options to CLI `init` command: - `--graphql.path` : To provide custom graphql path - `--rest.disabled`: To disable rest endpoints globally - `--graphql.disabled`: To disable graphql endpoints globally ## Why did i use `--rest.disabled/--graphql.disabled` instead of `--rest.enabled/--graphql.enabled` ? - the boolean options do not accept values. so, we cannot do --rest.enabled false. Just using this flag means true. - By default REST/GraphQL points are enabled, hence it's more convinient to use `--rest.disabled/--graphql.disabled` only when we want to disable it. reduces the length of command. ## How was this tested? - [x] Integration Tests - [x] Unit Tests ## Sample Request(s) dab init --database-type mssql ```json "runtime": { "rest": { "enabled": true, "path": "/api" }, "graphql": { "allow-introspection": true, "enabled": true, "path": "/graphql" }, ... } ``` dab init --database-type mssql --rest.disabled --graphql.disabled ```json "runtime": { "rest": { "enabled": false, "path": "/api" }, "graphql": { "allow-introspection": true, "enabled": false, "path": "/graphql" }, ... } ``` dab init --database-type mssql --rest.disabled --graphql.path /mygraphql ```json "runtime": { "rest": { "enabled": false, "path": "/api" }, "graphql": { "allow-introspection": true, "enabled": true, "path": "/mygraphql" }, ... } ``` 
Why make this change?
dab init#633What is this change?
initcommand:--graphql.path: To provide custom graphql path--rest.disabled: To disable rest endpoints globally--graphql.disabled: To disable graphql endpoints globallyWhy did i use
--rest.disabled/--graphql.disabledinstead of--rest.enabled/--graphql.enabled?--rest.disabled/--graphql.disabledonly when we want to disable it. reduces the length of command.How was this tested?
Sample Request(s)
dab init --database-type mssql
dab init --database-type mssql --rest.disabled --graphql.disabled
dab init --database-type mssql --rest.disabled --graphql.path /mygraphql