-
Notifications
You must be signed in to change notification settings - Fork 288
Description
I want to bring to attention the following scenario which breaks and can be a bug.
- Creating a stored procedure entity with graphql configured for Query
Command: dab add getbooks --source "get_books" --source.type "stored-procedure" --permissions "anonymous:execute" --graphql.operation "query"
Config Json (just the entities section):
"entities": {
"getbooks": {
"source": {
"object": "get_books",
"type": "stored-procedure",
"parameters": null,
"key-fields": null
},
"graphql": {
"enabled": true,
"operation": "query",
"type": {
"singular": "getbooks",
"plural": "getbooks"
}
},
"rest": {
"enabled": true,
"path": null,
"methods": [
"post"
]
},
"permissions": [
{
"role": "anonymous",
"actions": [
{
"action": "execute",
"fields": null,
"policy": {
"request": null,
"database": null
}
}
]
}
],
"mappings": null,
"relationships": null
}
}- Update the rest method to GET
Command:dab update getbooks --rest.methods "GET"
Config Json:
"entities": {
"getbooks": {
"source": {
"object": "get_books",
"type": "stored-procedure",
"parameters": null,
"key-fields": null
},
"graphql": {
"enabled": true,
"operation": "mutation",
"type": {
"singular": "getbooks",
"plural": "getbooks"
}
},
"rest": {
"enabled": true,
"path": null,
"methods": [
"get"
]
},
"permissions": [
{
"role": "anonymous",
"actions": [
{
"action": "execute",
"fields": null,
"policy": {
"request": null,
"database": null
}
}
]
}
],
"mappings": null,
"relationships": null
}
}
When updating the rest.methods, the graphql operation has lost its original value of query. It now has the default value of mutation.
This scenario works fine in the current main branch. Please find below the commands and the config jsons generated using the main branch.
- Creating a new stored procedure entity
Command:dab add getbooks --source "getbooks" --source.type "stored-procedure" --permissions "anonymous:execute" --graphql.operation "query"
Config json:
"entities": {
"getbooks": {
"source": {
"type": "stored-procedure",
"object": "getbooks"
},
"permissions": [
{
"role": "anonymous",
"actions": [
"execute"
]
}
],
"rest": {
"methods": [
"post"
]
},
"graphql": {
"operation": "query"
}
}
}- Updating the rest methods
Command:dab update getbooks --rest.methods "get"
Config json:
"entities": {
"getbooks": {
"source": {
"type": "stored-procedure",
"object": "getbooks"
},
"permissions": [
{
"role": "anonymous",
"actions": [
"execute"
]
}
],
"rest": {
"methods": [
"get"
]
},
"graphql": {
"operation": "query"
}
}
}The value present in the graphql operation is preserved. Only the rest methods are updated.
Would greatly appreciate if you could take a look at this.
Originally posted by @severussundar in #1402 (comment)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status