Skip to content

Commit bd129d9

Browse files
committed
Fix DwSql stored procedure GraphQL operations
- Add --graphql.operation query to GetBooks add command - Fix GetBooks and GetPublisher update commands to use lowercase query - Extend post-processing script to also handle DwSql configs - Regenerate dab-config.DwSql.json with correct query operations
1 parent 7daebc2 commit bd129d9

File tree

3 files changed

+2876
-2758
lines changed

3 files changed

+2876
-2758
lines changed

config-generators/config-generator.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ foreach($databaseType in $databaseTypes){
7171
Invoke-Expression $commandToExecute;
7272
}
7373

74-
# Post-process MsSql config to fix stored procedure GraphQL operations
74+
# Post-process MsSql and DwSql configs to fix stored procedure GraphQL operations
7575
# The CLI currently ignores --graphql.operation parameter for stored procedures,
7676
# defaulting them to 'mutation'. We manually fix specific procedures that should be 'query'.
77-
if($databaseType -eq "mssql"){
77+
if($databaseType -eq "mssql" -or $databaseType -eq "dwsql"){
7878
$configContent = Get-Content $configFile -Raw | ConvertFrom-Json;
7979
if($configContent.entities.GetBooks){
8080
$configContent.entities.GetBooks.graphql.operation = "query";

config-generators/dwsql-commands.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ add Journal --config "dab-config.DwSql.json" --source "journals" --rest true --g
2727
add ArtOfWar --config "dab-config.DwSql.json" --source "aow" --rest true --graphql false --permissions "anonymous:*" --source.key-fields "NoteNum"
2828
add stocks_view_selected --config "dab-config.DwSql.json" --source stocks_view_selected --source.type "view" --source.key-fields "categoryid,pieceid" --permissions "anonymous:*" --rest true --graphql true
2929
add GetBook --config "dab-config.DwSql.json" --source "get_book_by_id" --source.type "stored-procedure" --permissions "anonymous:execute" --rest true --graphql false
30-
add GetBooks --config "dab-config.DwSql.json" --source "get_books" --source.type "stored-procedure" --permissions "anonymous:execute" --rest true --graphql true
30+
add GetBooks --config "dab-config.DwSql.json" --source "get_books" --source.type "stored-procedure" --permissions "anonymous:execute" --rest true --graphql true --graphql.operation "query"
3131
add GetPublisher --config "dab-config.DwSql.json" --source "get_publisher_by_id" --source.type "stored-procedure" --permissions "anonymous:execute" --rest true --graphql true --graphql.operation "query"
3232
add GetAuthorsHistoryByFirstName --config "dab-config.DwSql.json" --source "get_authors_history_by_first_name" --source.type "stored-procedure" --source.params "firstName:Aaron" --permissions "anonymous:execute" --rest true --graphql SearchAuthorByFirstName
3333
add CountBooks --config "dab-config.DwSql.json" --source "count_books" --source.type "stored-procedure" --permissions "anonymous:execute" --rest true --graphql true
@@ -152,8 +152,8 @@ update InsertBook --config "dab-config.DwSql.json" --permissions "authenticated:
152152
update DeleteLastInsertedBook --config "dab-config.DwSql.json" --permissions "authenticated:execute"
153153
update UpdateBookTitle --config "dab-config.DwSql.json" --permissions "authenticated:execute"
154154
update InsertAndDisplayAllBooksUnderGivenPublisher --config "dab-config.DwSql.json" --permissions "authenticated:execute"
155-
update GetPublisher --config "dab-config.DwSql.json" --permissions "authenticated:execute"
156-
update GetBooks --config "dab-config.DwSql.json" --permissions "authenticated:execute" --graphql.operation "Query" --rest.methods "Get"
155+
update GetPublisher --config "dab-config.DwSql.json" --permissions "authenticated:execute" --graphql.operation "query"
156+
update GetBooks --config "dab-config.DwSql.json" --permissions "authenticated:execute" --graphql.operation "query" --rest.methods "Get"
157157
update GetBook --config "dab-config.DwSql.json" --permissions "authenticated:execute" --rest.methods "Get"
158158
update CountBooks --config "dab-config.DwSql.json" --permissions "authenticated:execute"
159159
update Sales --config "dab-config.DwSql.json" --permissions "authenticated:*"

0 commit comments

Comments
 (0)