-
Notifications
You must be signed in to change notification settings - Fork 247
[GraphQL] Updates to Stored Procedure support for Engine #1095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think you meant to set Just clarifying, the developer can override the default method for REST (and operation for GraphQL) but they CANNOT override the action If |
That is right, I have corrected it now. |
Do we want to have the following restrictions for the operations defined for an Stored Procedures REST/GraphQL operations? Key:
e.g. If GraphQL operation is mutation, REST operation cannot be GET. |
By default, does it mean REST on stored procedure entities won't support any of the other mutation operations - PUT/PATCH/DELETE ? These methods will only be allowed if explicitly configured, otherwise they will result in a bad request. |
If the developer is explicitly configuring REST method to be GET, and specifies nothing for GraphQL, they will end up in a situation where default is picked for GraphQL which is mutation. If we restrict this, the developer has to modify the config file, to override the default operation for GraphQL to be query, which seems additional overhead if I am only using REST. |
Shouldn't |
|
Also want to identify how to name the GraphQL mutation with the new operation "execute". |
That make sense. |
Yes, that makes sense and is coherent with what we do already, so let's go with this. A developer can always specified the name the want to use via the |
Following what @Aniruddh25 suggested I call the option |
@yorek, we currently do not allow developers to fully rename the query/mutation. Only the GraphQL singular/plural value of the entity. so in this case, we would always prefix with "execute" but the will be sourced from what the developer defines in entity.graphql.singular or entity.graphql.plural. Query has an edge case too, where the queries |
@seantleonard ah, right. Let's go with the "execute" prefix then with no ability, at the moment, to remove it. For GraphQL, if a developer wants to have the Stored Procedure exposed as a Query instead of a Mutation, only one query object will be generated (so no
Btw, just to make sure we're on the same page, even if "Mutation" will be chosed as the object to be generated, only one mutation will be produced named exactly as the query:
What do you think? |
@yorek, makes sense to me. |
There are already |
Currently that is how i have it implemented but haven't added additional restrictions to make |
Using |
If the |
Closing the rfc since all implementing issues have been closed. The doc is in this PR: #1163 |
Uh oh!
There was an error while loading. Please reload this page.
Summary
Add a new
execute
permission to make it easier to publish stored proceduresMotivation
Supporting Stored Procedure execution via methods other than POST for REST and Queries for GraphQL creates some confusion on how permissions are defined and also it leads to a potential break of best practices regarding the idempotency of non-POST methods.
Functional Specification
To best support Stored Procedure in Data API Builder, we may want to introduce a new action, named
execute
thatUsers will be able to decide if they want to use another method other than POST and generating a Query instead of a Mutation by defining their preference using the
rest
orgraphql
objects that are optionally available withing the entity object. For example:With this approach we can provide developers the best behaviour by default, but let them decide what is best for them if they need to depart from the best practices for any reasons.
References
[GraphQL] Stored Procedure support for Engine
[REST] Update/Create is breaking with Single Permission
Support stored procedure
Behavior of Update Action for Stored-Procedures in CLI
The text was updated successfully, but these errors were encountered: