Skip to content
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

resultsCallbackFn position in ContextHandler #77

Open
janderssen opened this issue Jan 4, 2021 · 0 comments
Open

resultsCallbackFn position in ContextHandler #77

janderssen opened this issue Jan 4, 2021 · 0 comments

Comments

@janderssen
Copy link

Hi,

Just wondering what the best way to abort multiple mutations in a single graphql call, currently I have moved the following code :
if h.resultCallbackFn != nil {
h.resultCallbackFn(ctx, &params, result, buff)
}

To just after the line : result := graphql.Do(params)

This way I can verify if all the mutations supplied to the graphql endpoint have been saved to the database and passes any extra validation as required for our business logic, if this fails, I am able to here fail the entire set of mutations.

Would prefer to use the library "as is" without modifying it, as I assume you guys are the ones in the know what is right and wrong with using this library, do you recommend a better solution, or have a done an acceptable solution ?

Thanks in advance
Cheers
Jason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant