Skip to content

Instantly share code, notes, and snippets.

@LawJolla
Last active March 1, 2018 14:57
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 LawJolla/6f687cff5cde4149dfd4ee417def763b to your computer and use it in GitHub Desktop.
Save LawJolla/6f687cff5cde4149dfd4ee417def763b to your computer and use it in GitHub Desktop.
Directed Schema
directive @isAuthenticated on FIELD | FIELD_DEFINITION
directive @hasRole(role: String) on FIELD | FIELD_DEFINITION
...
type Mutation {
updateAskingPrice(id: ID!, newPrice: Float!): Vehicle! @hasRole(role: "MANAGER")
}
...
type Vehicle {
id: ID!
year: Int!
make: String!
model: Int!
askingPrice: Float
costBasis: Float @hasRole(role: “MANAGER”)
numberOfOffers: Int @isAuthenticated
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment