-
-
Notifications
You must be signed in to change notification settings - Fork 579
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
Stored Procedure is not Relay compliant #110
Comments
What is the type signature for your procedure? (As a side note, I can't wait for Relay 2 where mutations won't be so declarative…) |
Hello Caleb, I'm working with @ssomnoremac on the problem. The proc returns type application which is a table in the db. The issue we are having is that you are wrapping the return with output{}, so it works fine with the graphiql interface but fails with relay. Relay cannot access a nested object, output.application is not allowed. |
Why not do a As a side note, I see how the solution may seem simple (move If this is critical for you and running |
Yes I agree the problem is very complicated and nuanced, especially with all the different parts that need to work together in a sometimes hidden way (relay mostly). I believe the heart of the problem could be that most of these technologies are designed around a document database and not a relational. Anyway, I have a couple of more things I want to try so I can give you concrete examples of what is not working. |
I’m going to close this as its in the PostGraphQL 2.0 beta 🎉 Specifically, all related tables are including in create mutations, update mutations, delete mutations, and procedure mutations that return a table. Start playing with the pre-release, the final release should be out really soon. Tell me what you think! 👍
|
Because the mutation payload of a stored procedure is nested in the output field, the Relay fatQuery must look something like this:
output
is the only acceptable root field for the fatQuery fragment besidesviewer
. However, the fatQuery must include a field that you intend to modify in thegetConfigs()
:if the response from the stored procedure wasn't nested in the
output
field and the response fields matched the field types, all would be fine. But that isn't the case and I'm not sure it's possible to fix this using Relay.The text was updated successfully, but these errors were encountered: