Skip to content

Commit

Permalink
chore: GQL schema changes
Browse files Browse the repository at this point in the history
  • Loading branch information
josebui committed Nov 22, 2023
1 parent 3e97fbf commit 02b6b80
Showing 1 changed file with 111 additions and 141 deletions.
252 changes: 111 additions & 141 deletions terraso_backend/apps/graphql/schema/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,14 @@ type Query {
"""The ID of the object"""
id: ID!
): LandscapeGroupNode!
membership(
"""The ID of the object"""
id: ID!
): MembershipNode!
groupAssociation(
"""The ID of the object"""
id: ID!
): GroupAssociationNode!
groups(offset: Int, before: String, after: String, first: Int, last: Int, name: String, name_Icontains: String, name_Istartswith: String, slug: String, slug_Icontains: String, description_Icontains: String, memberships_Email: String, associatedLandscapes_IsDefaultLandscapeGroup: Boolean, associatedLandscapes_Isnull: Boolean, associatedLandscapes_IsPartnership: Boolean): GroupNodeConnection
landscapes(offset: Int, before: String, after: String, first: Int, last: Int, name_Icontains: String, description_Icontains: String, slug: String, slug_Icontains: String, website_Icontains: String, location_Icontains: String): LandscapeNodeConnection
groups(offset: Int, before: String, after: String, first: Int, last: Int, name: String, name_Icontains: String, name_Istartswith: String, slug: String, slug_Icontains: String, description_Icontains: String, memberships_Email: String, associatedLandscapes_Isnull: Boolean, associatedLandscapes_IsPartnership: Boolean): GroupNodeConnection
landscapes(offset: Int, before: String, after: String, first: Int, last: Int, name_Icontains: String, description_Icontains: String, slug: String, slug_Icontains: String, website_Icontains: String, location_Icontains: String, membershipList_Memberships_User_Email: String): LandscapeNodeConnection
users(offset: Int, before: String, after: String, first: Int, last: Int, email: String, email_Icontains: String, email_Iexact: String, firstName_Icontains: String, lastName_Icontains: String, project: String): UserNodeConnection
landscapeGroups(offset: Int, before: String, after: String, first: Int, last: Int, landscape: ID, landscape_Slug_Icontains: String, group: ID, group_Slug_Icontains: String, isDefaultLandscapeGroup: Boolean, isPartnership: Boolean): LandscapeGroupNodeConnection
memberships(offset: Int, before: String, after: String, first: Int, last: Int, group: ID, group_In: [ID], group_Slug_Icontains: String, group_Slug_In: [String], user: ID, user_In: [ID], userRole: CoreMembershipUserRoleChoices, user_Email_Icontains: String, user_Email_In: [String], membershipStatus: CoreMembershipMembershipStatusChoices): MembershipNodeConnection
landscapeGroups(offset: Int, before: String, after: String, first: Int, last: Int, landscape: ID, landscape_Slug_Icontains: String, group: ID, group_Slug_Icontains: String, isPartnership: Boolean): LandscapeGroupNodeConnection
groupAssociations(offset: Int, before: String, after: String, first: Int, last: Int, parentGroup: ID, childGroup: ID, parentGroup_Slug_Icontains: String, childGroup_Slug_Icontains: String): GroupAssociationNodeConnection
dataEntry(
"""The ID of the object"""
Expand Down Expand Up @@ -103,15 +98,12 @@ type GroupNode implements Node {
website: String!
email: String!
createdBy: UserNode
membershipType: CoreGroupMembershipTypeChoices!
membershipList: CollaborationMembershipListNode
associationsAsParent(offset: Int, before: String, after: String, first: Int, last: Int, parentGroup: ID, childGroup: ID, parentGroup_Slug_Icontains: String, childGroup_Slug_Icontains: String): GroupAssociationNodeConnection!
associationsAsChild(offset: Int, before: String, after: String, first: Int, last: Int, parentGroup: ID, childGroup: ID, parentGroup_Slug_Icontains: String, childGroup_Slug_Icontains: String): GroupAssociationNodeConnection!
memberships(offset: Int, before: String, after: String, first: Int, last: Int, group: ID, group_In: [ID], group_Slug_Icontains: String, group_Slug_In: [String], user: ID, user_In: [ID], userRole: CoreMembershipUserRoleChoices, user_Email_Icontains: String, user_Email_In: [String], membershipStatus: CoreMembershipMembershipStatusChoices): MembershipNodeConnection!
associatedLandscapes(offset: Int, before: String, after: String, first: Int, last: Int, landscape: ID, landscape_Slug_Icontains: String, group: ID, group_Slug_Icontains: String, isDefaultLandscapeGroup: Boolean, isPartnership: Boolean): LandscapeGroupNodeConnection!
associatedLandscapes(offset: Int, before: String, after: String, first: Int, last: Int, landscape: ID, landscape_Slug_Icontains: String, group: ID, group_Slug_Icontains: String, isPartnership: Boolean): LandscapeGroupNodeConnection!
id: ID!
sharedResources(offset: Int, before: String, after: String, first: Int, last: Int, source_DataEntry_ResourceType_In: [String]): SharedResourceNodeConnection
accountMembership: MembershipNode
membershipsCount: Int
}

"""An object with an ID"""
Expand All @@ -126,7 +118,6 @@ type UserNode implements Node {
email: String!
profileImage: String!
preferences(offset: Int, before: String, after: String, first: Int, last: Int): UserPreferenceNodeConnection!
memberships(offset: Int, before: String, after: String, first: Int, last: Int, group: ID, group_In: [ID], group_Slug_Icontains: String, group_Slug_In: [String], user: ID, user_In: [ID], userRole: CoreMembershipUserRoleChoices, user_Email_Icontains: String, user_Email_In: [String], membershipStatus: CoreMembershipMembershipStatusChoices): MembershipNodeConnection!
id: ID!
}

Expand Down Expand Up @@ -172,59 +163,74 @@ type UserPreferenceNode implements Node {
id: ID!
}

type MembershipNodeConnection {
type CollaborationMembershipListNode implements Node {
enrollMethod: CollaborationMembershipListEnrollMethodChoices!
membershipType: CollaborationMembershipListMembershipTypeChoices!
memberships(offset: Int, before: String, after: String, first: Int, last: Int, user: ID, user_In: [ID], userRole: String, user_Email_Icontains: String, user_Email_In: [String], membershipStatus: CollaborationMembershipMembershipStatusChoices, user_Email_Not: String): CollaborationMembershipNodeConnection!
id: ID!
accountMembership: CollaborationMembershipNode
membershipsCount: Int
}

"""An enumeration."""
enum CollaborationMembershipListEnrollMethodChoices {
"""Join"""
JOIN

"""Invite"""
INVITE

"""Both"""
BOTH
}

"""An enumeration."""
enum CollaborationMembershipListMembershipTypeChoices {
"""Open"""
OPEN

"""Closed"""
CLOSED
}

type CollaborationMembershipNodeConnection {
"""Pagination data for this connection."""
pageInfo: PageInfo!

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

"""A Relay edge containing a `MembershipNode` and its cursor."""
type MembershipNodeEdge {
"""
A Relay edge containing a `CollaborationMembershipNode` and its cursor.
"""
type CollaborationMembershipNodeEdge {
"""The item at the end of the edge"""
node: MembershipNode!
node: CollaborationMembershipNode!

"""A cursor for use in pagination"""
cursor: String!
}

type MembershipNode implements Node {
group: GroupNode!
user: UserNode!
userRole: CoreMembershipUserRoleChoices!
membershipStatus: CoreMembershipMembershipStatusChoices!
type CollaborationMembershipNode implements Node {
membershipList: CollaborationMembershipListNode!
user: UserNode
userRole: String!
membershipStatus: CollaborationMembershipMembershipStatusChoices!
pendingEmail: String
id: ID!
}

"""An enumeration."""
enum CoreMembershipUserRoleChoices {
"""Manager"""
MANAGER

"""Member"""
MEMBER
}

"""An enumeration."""
enum CoreMembershipMembershipStatusChoices {
enum CollaborationMembershipMembershipStatusChoices {
"""Approved"""
APPROVED

"""Pending"""
PENDING
}

"""An enumeration."""
enum CoreGroupMembershipTypeChoices {
"""Open"""
OPEN

"""Closed"""
CLOSED
}

type GroupAssociationNodeConnection {
"""Pagination data for this connection."""
pageInfo: PageInfo!
Expand Down Expand Up @@ -270,7 +276,6 @@ type LandscapeGroupNodeEdge {
type LandscapeGroupNode implements Node {
landscape: LandscapeNode!
group: GroupNode!
isDefaultLandscapeGroup: Boolean!
isPartnership: Boolean!
partnershipYear: Int
id: ID!
Expand All @@ -286,18 +291,18 @@ type LandscapeNode implements Node {
email: String!
areaScalarM2: Float
createdBy: UserNode
membershipList: CollaborationMembershipListNode
taxonomyTerms(offset: Int, before: String, after: String, first: Int, last: Int, type: CoreTaxonomyTermTypeChoices, type_In: [CoreTaxonomyTermTypeChoices]): TaxonomyTermNodeConnection!
population: Int
partnershipStatus: CoreLandscapePartnershipStatusChoices
profileImage: String!
profileImageDescription: String!
centerCoordinates: Point
associatedDevelopmentStrategy(offset: Int, before: String, after: String, first: Int, last: Int): LandscapeDevelopmentStrategyNodeConnection!
associatedGroups(offset: Int, before: String, after: String, first: Int, last: Int, landscape: ID, landscape_Slug_Icontains: String, group: ID, group_Slug_Icontains: String, isDefaultLandscapeGroup: Boolean, isPartnership: Boolean): LandscapeGroupNodeConnection!
associatedGroups(offset: Int, before: String, after: String, first: Int, last: Int, landscape: ID, landscape_Slug_Icontains: String, group: ID, group_Slug_Icontains: String, isPartnership: Boolean): LandscapeGroupNodeConnection!
id: ID!
sharedResources(offset: Int, before: String, after: String, first: Int, last: Int, source_DataEntry_ResourceType_In: [String]): SharedResourceNodeConnection
areaTypes: [String]
defaultGroup: GroupNode
areaScalarHa: Float
}

Expand Down Expand Up @@ -598,61 +603,6 @@ type StoryMapNode implements Node {
membershipList: CollaborationMembershipListNode
}

type CollaborationMembershipListNode implements Node {
membershipType: CollaborationMembershipListMembershipTypeChoices!
memberships(offset: Int, before: String, after: String, first: Int, last: Int, user: ID, user_In: [ID], userRole: String, user_Email_Icontains: String, user_Email_In: [String], membershipStatus: CollaborationMembershipMembershipStatusChoices, user_Email_Not: String): CollaborationMembershipNodeConnection!
id: ID!
accountMembership: CollaborationMembershipNode
membershipsCount: Int
}

"""An enumeration."""
enum CollaborationMembershipListMembershipTypeChoices {
"""Open"""
OPEN

"""Closed"""
CLOSED
}

type CollaborationMembershipNodeConnection {
"""Pagination data for this connection."""
pageInfo: PageInfo!

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

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

"""A cursor for use in pagination"""
cursor: String!
}

type CollaborationMembershipNode implements Node {
membershipList: CollaborationMembershipListNode!
user: UserNode
userRole: String!
membershipStatus: CollaborationMembershipMembershipStatusChoices!
pendingEmail: String
id: ID!
}

"""An enumeration."""
enum CollaborationMembershipMembershipStatusChoices {
"""Approved"""
APPROVED

"""Pending"""
PENDING
}

type StoryMapNodeConnection {
"""Pagination data for this connection."""
pageInfo: PageInfo!
Expand Down Expand Up @@ -701,6 +651,7 @@ type ProjectNode implements Node {
}

type ProjectMembershipListNode implements Node {
enrollMethod: CollaborationMembershipListEnrollMethodChoices!
membershipType: CollaborationMembershipListMembershipTypeChoices!
memberships(offset: Int, before: String, after: String, first: Int, last: Int, user: ID, user_In: [ID], userRole: String, user_Email_Icontains: String, user_Email_In: [String], membershipStatus: CollaborationMembershipMembershipStatusChoices, user_Email_Not: String): ProjectMembershipNodeConnection!
id: ID!
Expand Down Expand Up @@ -1642,17 +1593,14 @@ type Mutations {
addUser(input: UserAddMutationInput!): UserAddMutationPayload!
addLandscapeGroup(input: LandscapeGroupAddMutationInput!): LandscapeGroupAddMutationPayload!
addGroupAssociation(input: GroupAssociationAddMutationInput!): GroupAssociationAddMutationPayload!
addMembership(input: MembershipAddMutationInput!): MembershipAddMutationPayload!
updateGroup(input: GroupUpdateMutationInput!): GroupUpdateMutationPayload!
updateLandscape(input: LandscapeUpdateMutationInput!): LandscapeUpdateMutationPayload!
updateMembership(input: MembershipUpdateMutationInput!): MembershipUpdateMutationPayload!
updateUser(input: UserUpdateMutationInput!): UserUpdateMutationPayload!
deleteGroup(input: GroupDeleteMutationInput!): GroupDeleteMutationPayload!
deleteLandscape(input: LandscapeDeleteMutationInput!): LandscapeDeleteMutationPayload!
deleteUser(input: UserDeleteMutationInput!): UserDeleteMutationPayload!
deleteLandscapeGroup(input: LandscapeGroupDeleteMutationInput!): LandscapeGroupDeleteMutationPayload!
deleteGroupAssociation(input: GroupAssociationDeleteMutationInput!): GroupAssociationDeleteMutationPayload!
deleteMembership(input: MembershipDeleteMutationInput!): MembershipDeleteMutationPayload!
updateUserPreference(input: UserPreferenceUpdateInput!): UserPreferenceUpdatePayload!
deleteUserPreference(input: UserPreferenceDeleteInput!): UserPreferenceDeletePayload!
unsubscribeUser(input: UserUnsubscribeUpdateInput!): UserUnsubscribeUpdatePayload!
Expand Down Expand Up @@ -1690,6 +1638,10 @@ type Mutations {
addSiteNote(input: SiteNoteAddMutationInput!): SiteNoteAddMutationPayload!
updateSiteNote(input: SiteNoteUpdateMutationInput!): SiteNoteUpdateMutationPayload!
deleteSiteNote(input: SiteNoteDeleteMutationInput!): SiteNoteDeleteMutationPayload!
saveLandscapeMembership(input: LandscapeMembershipSaveMutationInput!): LandscapeMembershipSaveMutationPayload!
deleteLandscapeMembership(input: LandscapeMembershipDeleteMutationInput!): LandscapeMembershipDeleteMutationPayload!
saveGroupMembership(input: GroupMembershipSaveMutationInput!): GroupMembershipSaveMutationPayload!
deleteGroupMembership(input: GroupMembershipDeleteMutationInput!): GroupMembershipDeleteMutationPayload!
}

type GroupAddMutationPayload {
Expand Down Expand Up @@ -1766,19 +1718,6 @@ input GroupAssociationAddMutationInput {
clientMutationId: String
}

type MembershipAddMutationPayload {
errors: GenericScalar
membership: MembershipNode
clientMutationId: String
}

input MembershipAddMutationInput {
userEmail: String!
groupSlug: String!
userRole: String
clientMutationId: String
}

type GroupUpdateMutationPayload {
errors: GenericScalar
group: GroupNode
Expand Down Expand Up @@ -1820,19 +1759,6 @@ input LandscapeUpdateMutationInput {
clientMutationId: String
}

type MembershipUpdateMutationPayload {
errors: GenericScalar
membership: MembershipNode
clientMutationId: String
}

input MembershipUpdateMutationInput {
id: ID!
userRole: String
membershipStatus: String
clientMutationId: String
}

type UserUpdateMutationPayload {
errors: GenericScalar
user: UserNode
Expand Down Expand Up @@ -1903,17 +1829,6 @@ input GroupAssociationDeleteMutationInput {
clientMutationId: String
}

type MembershipDeleteMutationPayload {
errors: GenericScalar
membership: MembershipNode
clientMutationId: String
}

input MembershipDeleteMutationInput {
id: ID
clientMutationId: String
}

type UserPreferenceUpdatePayload {
errors: GenericScalar
preference: UserPreferenceNode
Expand Down Expand Up @@ -2466,3 +2381,58 @@ input SiteNoteDeleteMutationInput {
id: ID!
clientMutationId: String
}

type LandscapeMembershipSaveMutationPayload {
errors: GenericScalar
memberships: [CollaborationMembershipNode]
landscape: LandscapeNode
clientMutationId: String
}

input LandscapeMembershipSaveMutationInput {
userRole: String!
userEmails: [String]!
landscapeSlug: String!
clientMutationId: String
}

type LandscapeMembershipDeleteMutationPayload {
errors: GenericScalar
membership: CollaborationMembershipNode
landscape: LandscapeNode
clientMutationId: String
}

input LandscapeMembershipDeleteMutationInput {
id: ID!
landscapeSlug: String!
clientMutationId: String
}

type GroupMembershipSaveMutationPayload {
errors: GenericScalar
memberships: [CollaborationMembershipNode]
group: GroupNode
clientMutationId: String
}

input GroupMembershipSaveMutationInput {
userRole: String
userEmails: [String]!
groupSlug: String!
membershipStatus: String
clientMutationId: String
}

type GroupMembershipDeleteMutationPayload {
errors: GenericScalar
membership: CollaborationMembershipNode
group: GroupNode
clientMutationId: String
}

input GroupMembershipDeleteMutationInput {
id: ID!
groupSlug: String!
clientMutationId: String
}

0 comments on commit 02b6b80

Please sign in to comment.