Last active
April 30, 2016 00:50
-
-
Save helfer/52e9629623c63addd05e4f355e6072ac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sample GraphQL schema with decorators | |
+connector(storage: "MySQL") | |
+doc(description: "A Person") | |
type Person { | |
+mock(type: "ID") | |
id: Int | |
+mock(raw: "John") | |
name: String | |
+requireAuthRole(role: "admin") | |
age: Int | |
} | |
+log(info: "query") | |
type Query { | |
findPerson(name: String!): Person | |
+requireAuthRole(role: "admin") | |
allPeople(): [Person] | |
} | |
+log(info: "mutation") | |
+requireAuthRole(role: "admin") | |
type Mutation { | |
addPerson( | |
+validateLength(min: 1, max:100) | |
name: String! | |
): Person | |
removePerson(id: Int!): Boolean | |
} | |
schema { | |
query: Query | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment