Split each API's monolithic schema.graphql into per-coredata-model
files under graphql/ subdirectories. gqlgen's follow-schema layout
with {name}.resolvers.go template generates one resolver file per
schema file. Relay uses schema + schemaExtensions to load the split
files.
Connect API: 8 files (base, session, organization, profile,
personal_api_key, saml, scim, audit_log)
Trust API: 5 files (base, trust_center, auth, nda, mailing_list)
Console API: 25 files covering all domain entities
Types extended across files (Organization, Mutation, Viewer,
TrustCenter, Identity) are defined in base.graphql as required by
Relay's schemaExtensions.
Signed-off-by: Émile Ré <emile@getprobo.com>
93 lines
2.1 KiB
GraphQL
93 lines
2.1 KiB
GraphQL
extend type Organization {
|
|
meetings(
|
|
first: Int
|
|
after: CursorKey
|
|
last: Int
|
|
before: CursorKey
|
|
orderBy: MeetingOrder
|
|
): MeetingConnection! @goField(forceResolver: true)
|
|
}
|
|
|
|
enum MeetingOrderField
|
|
@goModel(model: "go.probo.inc/probo/pkg/coredata.MeetingOrderField") {
|
|
DATE @goEnum(value: "go.probo.inc/probo/pkg/coredata.MeetingOrderFieldDate")
|
|
NAME @goEnum(value: "go.probo.inc/probo/pkg/coredata.MeetingOrderFieldName")
|
|
CREATED_AT
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.MeetingOrderFieldCreatedAt"
|
|
)
|
|
}
|
|
|
|
input MeetingOrder
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.MeetingOrderBy"
|
|
) {
|
|
direction: OrderDirection!
|
|
field: MeetingOrderField!
|
|
}
|
|
|
|
type Meeting implements Node {
|
|
id: ID!
|
|
name: String!
|
|
date: Datetime!
|
|
minutes: String
|
|
attendees: [Profile!]! @goField(forceResolver: true)
|
|
organization: Organization! @goField(forceResolver: true)
|
|
createdAt: Datetime!
|
|
updatedAt: Datetime!
|
|
|
|
permission(action: String!): Boolean! @goField(forceResolver: true)
|
|
}
|
|
|
|
type MeetingConnection
|
|
@goModel(
|
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.MeetingConnection"
|
|
) {
|
|
totalCount: Int! @goField(forceResolver: true)
|
|
edges: [MeetingEdge!]!
|
|
pageInfo: PageInfo!
|
|
}
|
|
|
|
type MeetingEdge {
|
|
cursor: CursorKey!
|
|
node: Meeting!
|
|
}
|
|
|
|
extend type Mutation {
|
|
createMeeting(input: CreateMeetingInput!): CreateMeetingPayload!
|
|
updateMeeting(input: UpdateMeetingInput!): UpdateMeetingPayload!
|
|
deleteMeeting(input: DeleteMeetingInput!): DeleteMeetingPayload!
|
|
}
|
|
|
|
input CreateMeetingInput {
|
|
organizationId: ID!
|
|
name: String!
|
|
date: Datetime!
|
|
attendeeIds: [ID!]
|
|
minutes: String
|
|
}
|
|
|
|
input UpdateMeetingInput {
|
|
meetingId: ID!
|
|
name: String
|
|
date: Datetime
|
|
attendeeIds: [ID!]
|
|
minutes: String @goField(omittable: true)
|
|
}
|
|
|
|
input DeleteMeetingInput {
|
|
meetingId: ID!
|
|
}
|
|
|
|
type CreateMeetingPayload {
|
|
meetingEdge: MeetingEdge!
|
|
}
|
|
|
|
type UpdateMeetingPayload {
|
|
meeting: Meeting!
|
|
}
|
|
|
|
type DeleteMeetingPayload {
|
|
deletedMeetingId: ID!
|
|
}
|