Last active
April 18, 2018 15:24
-
-
Save lightsofapollo/1aaab491b961c28cc7a0f6ef1b74dea8 to your computer and use it in GitHub Desktop.
This file contains 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
[@gql.name "AuthRoles"] | |
[@gql.comment "Authentication roles for all users"] | |
[@gql.type] | |
type authRoles = [ | `SuperUser | `Administrator | `User]; | |
[@gql.type] | |
module User = { | |
type t = { | |
id: string, | |
email: string, | |
name: string, | |
role: option(authRoles), | |
}; | |
let id = (root: t) => root.id; | |
let email = (root: t) => root.email; | |
let name = (root: t) => root.email; | |
let role = (root: t) => root.role; | |
}; | |
[@gql.type] | |
[@gql.comment "All queries for graphql"] | |
module Query = { | |
let users = () => {/* return list of user types */}; | |
let userById: string => User.t = | |
id => {id, email: "[email protected]", name: "james", role: None}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment