-
Notifications
You must be signed in to change notification settings - Fork 65
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
Add 'arguments' to AddSingleField #168
Comments
If you like, I can post a pull request, but it would be later this week, as I have not delved into the source code as of yet. |
It appears QueryGraphType<> class just maps functions from the IEfGraphQLService<> interface. So I accessed the IEfGraphQLService<> directly in my code. I did post a pull request, but the code didn't end up helping me because I needed to return an additional field. So I wrapped the field in another graph and accessed IEfGraphQlService<> from it directly, bypassing the QueryGraphType<> class. The end result is exactly as I was hoping! Incidentally, adding this extra graph solved another issue with this functionality - namely, that AddSingleField is not available in an async version. Since my code performs a bunch of database work to execute the mutation, it would definitely preferred for it to be an async function. |
did you read the part about being a Patron? https://github.com/SimonCropp/GraphQL.EntityFramework/blob/master/doco/licensing-patron-faq.md#licensingpatron-faq |
Yes. I signed up before posting (under the company name Zbox). |
Ok so I find OpenCollective very confusing. I'm sure I subscribed yesterday, but I can't find it listed in my account. I even have a thank-you confirmation email, so I know it went through. And if I wanted to change the subscription amount, I'm not sure how I'd do that. Not only that, it says somewhere that I should link the account to GitHub, and I can't find anywhere to do that. I didn't see multiple tiers of subscriptions, and if you can do that I'd suggest it. |
Figured it out....I think. |
dont worry about the patron thing. checked my email and u show up, but u dont show on the patrons site. i will ping opencollective and ask whats up. thanks for the effort. deploying your arg change now. should show up on nuget in ~20min. thanks for the effort :) |
Suggestion: Although QueryGraphType.AddQueryField has an arguments parameter, AddSingleField does not. I would like to suggest that this feature be added. This will be useful because I want to implement the mutation class as a QueryGraphType, utilizing AddSingleField to allow the return type to provide potentially the entire graph (including subtables) of the updated data. So it would be coded like any other mutation, except the last line would be return dbContext.MyTable.Where(x => x.Id == argumentModel.Id). This would have another benefit of not having to provide separate return graphs/models for mutations, as they can simply return the same graph/model as the query. Of course, another call to the database would be made for every update, but this could be viewed as a benefit, and would be necessary anyway if subtables were requested.
The text was updated successfully, but these errors were encountered: