Skip to content

@stateMachine annotation #22

@ian

Description

@ian

@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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions