You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have multilpe services and each have lot of mutations like
class SnMutations(graphene.ObjectType):
# Event mutations
create_event = CreateEvent.Field()
update_event = UpdateEvent.Field()
delete_event = DeleteEvent.Field()
# Venue mutations, Meetup does not allow to update a venue. Also it does not make sense.
create_venue = CreateVenue.Field()
# EventOrganizer mutations
create_event_organizer = CreateEventOrganizer.Field()
update_event_organizer = UpdateEventOrganizer.Field()
delete_event_organizer = DeleteEventOrganizer.Field()
# Authorization mutations
refresh_token = RefreshToken.Field()
add_social_network_credentials = AddSocialNetworkCredentials.Field()
and
class CandidateMutation(graphene.ObjectType):
create_candidate = CreateCandidate.Field()
update_candidate = UpdateCandidate.Field()
and more
Now I want to create schema with all these mutations but I want to send query for each mutation under a specific key like sn_mutations and candidate_mutations for candidate service.
I tries graphene.AbstractType and Inherited main Mutation class from all other Mutation class but in this way I can not divide mutation for every service in query under a specific key like sn_mutations and candidate_mutations.
Any help is most appreciated.
The text was updated successfully, but these errors were encountered:
Hey @mzohaibqc
Just note that while using hierarchies in mutations is valid under the GraphQL spec, it will not work if you use Relay on your client to call it.
Relay enforces all mutations to be top-level: facebook/relay#551
Its very annoying, but thats the way it is :(
Anyway, if you still want to do it all you need to do is define a root:
class MutationRoot(graphene.ObjectType):
sn_mutations = graphene.Field(SnMutations)
def resolve_sn_mutations(self, *_):
return SnMutations()
Hi @mzohaibqc . We're currently going through old issues that appear to have gone stale (ie. not updated in about the last 6 months) to try and clean up the issue tracker. If this is still important to you please comment and we'll re-open this.
I have multilpe services and each have lot of mutations like
Now I want to create schema with all these mutations but I want to send query for each mutation under a specific key like
sn_mutations
andcandidate_mutations
for candidate service.But I can only pass a single class in schema.
I tries
graphene.AbstractType
and Inherited main Mutation class from all other Mutation class but in this way I can not divide mutation for every service in query under a specific key likesn_mutations
andcandidate_mutations
.Any help is most appreciated.
The text was updated successfully, but these errors were encountered: