Files
schemas/graph/schema.graphqls
T
argoyle 80daed081d feat: add Cosmo Router config generation and PubSub support
Creates a new `GenerateCosmoRouterConfig` function to build and 
serialize a Cosmo Router configuration from subgraphs. Implements 
PubSub mechanism for managing schema updates, allowing 
subscription to updates. Adds Subscription resolver and updates 
existing structures to accommodate new functionalities. This 
enhances the system's capabilities for dynamic updates and 
configuration management.
2025-11-19 11:29:30 +01:00

87 lines
1.4 KiB
GraphQL

type Query {
organizations: [Organization!]! @auth(user: true)
supergraph(ref: String!, isAfter: String): Supergraph! @auth(organization: true)
}
type Mutation {
addOrganization(name: String!): Organization! @auth(user: true)
addAPIKey(input: InputAPIKey): APIKey! @auth(user: true)
updateSubGraph(input: InputSubGraph!): SubGraph! @auth(organization: true)
}
type Subscription {
schemaUpdates(ref: String!): SchemaUpdate! @auth(organization: true)
}
type Organization {
id: ID!
name: String!
users: [User!]!
apiKeys: [APIKey!]!
}
type User {
id: String!
}
type APIKey {
id: ID!
name: String!
key: String
organization: Organization!
refs: [String!]!
read: Boolean!
publish: Boolean!
}
union Supergraph = Unchanged | SubGraphs
type Unchanged {
id: ID!
minDelaySeconds: Int!
}
type SubGraphs {
id: ID!
minDelaySeconds: Int!
sdl: String!
subGraphs: [SubGraph!]!
}
type SubGraph {
id: ID!
service: String!
url: String
wsUrl: String
sdl: String!
changedBy: String!
changedAt: Time!
}
type SchemaUpdate {
ref: String!
id: ID!
subGraphs: [SubGraph!]!
cosmoRouterConfig: String
}
input InputAPIKey {
name: String!
organizationId: ID!
refs: [String!]!
read: Boolean!
publish: Boolean!
}
input InputSubGraph {
ref: String!
service: String!
url: String
wsUrl: String
sdl: String!
}
scalar Time
directive @auth(user: Boolean, organization: Boolean) on FIELD_DEFINITION