@thelinuxlich found a cool SM library that would be really easy to integrate as a Rel extension:
https://github.com/StoneCypher/jssm
What if we expose this as a directive. Consider:
type Post {
state: String! @stateMachine('draft -> published -> archived')
}
This would produce:
type Post {
id: ID!
state: String!
}
type Mutation {
nextStateMachineForPost(id: ID!): Post
prevStateMachineForPost(id: ID!): Post
setStateMachineForPost(id: ID!): Post
}
@thelinuxlich found a cool SM library that would be really easy to integrate as a Rel extension:
https://github.com/StoneCypher/jssm
What if we expose this as a directive. Consider:
This would produce: