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

Custom Mutation with Graffiti #1

Closed
TLevesque opened this issue Apr 22, 2017 · 2 comments
Closed

Custom Mutation with Graffiti #1

TLevesque opened this issue Apr 22, 2017 · 2 comments

Comments

@TLevesque
Copy link

Hi Marc,
I'm looking to setup some custom queries and mutations in addition to the default ones of the graffiti schema,
For example, I would like to create a mutation "createUser" which update 2 different collections when invoked, Graffiti looks nice, but there few documentation, do you have any advice?
Thank you very much for your help!
Thibaut

@MarcBernat
Copy link
Owner

Hi @TLevesque,

Nowadays graffitti-mongoose doesn't have any methodology for extend the generated schema or include customs queries/mutations. But, even so, the official graffiti repo has RisingStack/graffiti-mongoose#64 open issue with how-to extend schemas. However, they are only tips. This isn't a final solution and could be difficult to maintain the code in a short term.

In my case, I switched to other ways to develop the GraphQL Server:

  1. Creating the schema from the scratch. I reccomend this tutorial: https://learngraphql.com/ or learning from official docs.
  2. Using an intermediate method. Like generators: https://github.com/lucasbento/create-graphql or this repo https://github.com/apollographql/graphql-syntax with a few utilities.

In any case, here is the graffiti project for more info:
https://github.com/RisingStack/graffiti

Now I'm learning GraphQL, so, feel free to ask anything. 😄

@TLevesque
Copy link
Author

Hi Marc,
Thank you very much for your help and these great infos!!
Best,
Thibaut

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