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

Multiple mutations #27

Open
dberna2 opened this issue Apr 7, 2018 · 3 comments
Open

Multiple mutations #27

dberna2 opened this issue Apr 7, 2018 · 3 comments

Comments

@dberna2
Copy link

dberna2 commented Apr 7, 2018

@brimworks Seeing the example of the class GraphQLServlet see that it is has a queryRoot and a mutation such as MutatePosts, but for example, if you need have many mutations such as MutatePosts and "MutateAuthor", I see that it does not support it, is there any way to implement various mutations at the same time?

advance thanks and excellent help your contribution
👍

@brimworks
Copy link
Contributor

Graphql always requires a single root for all queries and a single root for all mutations.

https://graphql.org/learn/schema/#the-query-and-mutation-types

Perhaps my example is misleading since it is named MutatePosts? Feel free to issue a PR if you want to change the documentation.

Thanks,
-Brian

@dberna2
Copy link
Author

dberna2 commented Jan 1, 2019

Hello again Brian,

Again I'm doing graphql and I still like the functionality that has been implemented, but I have a doubt and I hope you can help me. I have tried to return custom errors, but these are not shown in the response json. The maximum I have achieved is "Internal Server Error (s) while executing query". Is there any way to handle errors with your library?

This is my project if you want to see that I am always willing to improve.

https://github.com/dberna2/graphql-example-apigen

Thank you.

@brimworks
Copy link
Contributor

@dberna2 do you have an example of your attempt at a custom error? Did you try following the instructions here?

https://www.howtographql.com/graphql-java/7-error-handling/

In particular the bit about defining the ExecutionStrategy#handleDataFetchingException method? Note that graphql-apigen simply generates POJO interfaces that make it easy to use graphql-java, so anything defined in graphql-java should work.

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

2 participants