Skip to content

Instantly share code, notes, and snippets.

@cowboyd
Created March 3, 2023 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cowboyd/fc85977e9b505a6d74e365392eed7580 to your computer and use it in GitHub Desktop.
Save cowboyd/fc85977e9b505a6d74e365392eed7580 to your computer and use it in GitHub Desktop.
Hypothetical GraphQL API for Backstage
interface Node {
id: ID!
}
interface Entity implements Node
@loads(from: "catalog")
@discriminates(with: "kind") {
id: ID!
kind: String!
}
interface Component implements Entity & Node
@discriminates(with: "spec.type") {
id: ID!
kind: String!
displayName: @field(at: "spec.profile.displayName")
}
type Service @implements(interface: "Component") {
id: ID!
}
type Library @implements(interface: "Component") {
id: ID!
}
type Website @implements(interface: "Component") {
id: ID!
}
interface Group
@implements(interface: "Entity")
@discriminates(with: "spec.type")
name: String! @field(at: "spec.profile.name") {
}
type BusinessUnit
@condition(when: "spec.type" is: "Organization")
@implements(interface: "Group") {
}
type Team @implements(interface: "Group") {}
type SubDepartment @implements(interface: "Group") {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment