Skip to content

How to use different GraphQLObjectType mutations in one root parameter of the schema? #289

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
odlainepre opened this issue Mar 23, 2017 · 5 comments

Comments

@odlainepre
Copy link

odlainepre commented Mar 23, 2017

Hi! I want to create different GraphQLObjectType mutation\queries for each separate model.

In present time in GraphQL server we have one schema with two parameters: queries and mutations.
Each of which accepts GraphQLObjectType and includes differents fields. In library we have some think like this on the example of mutations:

Mutations:
UserAdd
UserRemove
ArcicleAdd
MapAddPin
..etc

Root mutations include list of all fields, - yes because we import all fields in one GraphQLObjectType. I want to use for each separate model GraphQLObjectType, that i can get in my library next option:

Mutations:

  • User
    UserAdd
    UserRemove
  • Arcticle
    ArcicleAdd
  • Map
    MapAddPin

Thanks.

@robzhu
Copy link
Contributor

robzhu commented Apr 28, 2017

If I understand correctly, you would like some capability to organize your mutations hierarchically?

@odlainepre
Copy link
Author

@robzhu exactly

@stubailo
Copy link
Contributor

stubailo commented May 1, 2017

This is a duplicate of #252

@wincent
Copy link
Contributor

wincent commented May 4, 2017

@stubailo: Is it? I thought #252 was about implanting mutation/serial-execution semantics at arbitrary points within query operations, whereas this one seems to be about organization within mutation operations.

@stubailo
Copy link
Contributor

stubailo commented May 9, 2017

I want to use for each separate model GraphQLObjectType

My understanding is that @nikitamarcius wants to have separate mutation GraphQL Object Types for each kind of data. To me that sounds the same as being able to mark arbitrary GraphQL Object Types as a "mutation type", which is what #252 is about.

(Note that AFAIK the mutation type can already appear anywhere, if you just return it from a field: type Query { mutation: Mutation })

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

No branches or pull requests

4 participants