Skip to content

Instantly share code, notes, and snippets.

@lightsofapollo
Created April 23, 2018 21:05
Show Gist options
  • Save lightsofapollo/99d88f72b0d58e12b895c2f01ef785c4 to your computer and use it in GitHub Desktop.
Save lightsofapollo/99d88f72b0d58e12b895c2f01ef785c4 to your computer and use it in GitHub Desktop.
enum UserTypes {
SuperUser
Administrator
Customer
}
enum Gender {
"""
Men
"""
Male
"""
Women
"""
Female
NonBinary
}
input Wrapper {
foo: String
}
input GenderInput {
"""
the check
"""
check: Boolean!
another: ID
listOfStrings: [String]!
nullableListOfStrings: [String]
wrapper: Wrapper!
gender: Gender
}
type User @bsRecord(type: "User.t") {
name: String!
email: String!
gender: Gender
listNullable: [String]
list: [String]!
getGender(
"""
Do the check?
"""
check: GenderInput
): Gender!
self(check: Boolean!): User!
}
type Query {
user: User
}
type userTypes = [ | `SuperUser | `Administrator | `Customer]
and gender = [
| `Male /* Men */ /* Women */
| `Female /* Men */ /* Women */
| `NonBinary /* Men */ /* Women */
]
and wrapper = {foo: option(string)}
and genderInput = {
/* the check */
check: bool,
another: option(string),
listOfStrings: array(string),
nullableListOfStrings: option(array(string)),
wrapper,
gender: option(gender),
}
and user = {
name: string,
email: string,
gender: option(gender),
listNullable: option(array(string)),
list: array(string),
getGender:
/* Do the check? */
(~check: option(genderInput)=?, unit) =>
gender,
self: (~check: bool, unit) => user,
}
and query = {user: option(user)};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment