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

fix: Set SiteNoteNode to be not null #945

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions terraso_backend/apps/graphql/schema/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -794,13 +794,14 @@ type SiteNoteNodeConnection {
pageInfo: PageInfo!

"""Contains the nodes in this connection."""
edges: [SiteNoteNodeEdge]!
edges: [SiteNoteNodeEdge!]!
totalCount: Int!
}

"""A Relay edge containing a `SiteNoteNode` and its cursor."""
type SiteNoteNodeEdge {
"""The item at the end of the edge"""
node: SiteNoteNode
node: SiteNoteNode!

"""A cursor for use in pagination"""
cursor: String!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
from django.db import transaction
from graphene_django import DjangoObjectType

from apps.graphql.schema.commons import BaseDeleteMutation, BaseWriteMutation
from apps.graphql.schema.commons import (
BaseDeleteMutation,
BaseWriteMutation,
TerrasoConnection,
)
from apps.project_management.models.site_notes import SiteNote
from apps.project_management.models.sites import Site

Expand All @@ -30,6 +34,8 @@ class Meta:
fields = "__all__"
interfaces = (graphene.relay.Node,)

connection_class = TerrasoConnection


class SiteNoteAddMutation(BaseWriteMutation):
site_note = graphene.Field(SiteNoteNode, required=True)
Expand Down