I have a model named Project
and a CustomProject
model that inherits from it. Currently, I have two mutations one to add a project and one to add a custom project
class Project(models.Model):
url = models.URLField(blank=True)
description = models.TextField()
class CustomProject(Project):
role = models.CharField(max_length=15, null=True, blank=True)
mutation InsertProjects(
$projects: [graph_project_insert_input!]! = [
{
url: "https://github.com/smsajjadzaidi/FixedRouteSuggestion"
description: "_test_desc_"
}
]
) {
projects: insert_graph_project(
objects: $projects
on_conflict: {
constraint: graph_project_pkey
update_columns: [url, description]
}
) {
returning {
id
}
affected_rows
}
}
mutation InsertCustomProject(
$projects: [custom_project_insert_input!]! = [
{
project_ptr_id: 2
role:"author"
}
]
) {
customprojects: insert_custom_project(
objects: $projects
on_conflict: {
constraint: custom_project_pkey
update_columns: [role]
}
) {
returning {
graph_project{
id
}
}
affected_rows
}
}
Need a way to do the above in one mutation