Last active
January 17, 2019 14:47
-
-
Save zacck-zz/92113df9f14157e48e3db04947a8fdf0 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
-- GraphQL | |
type alias User = | |
{ username : Maybe String | |
, email : Maybe String | |
, id : Maybe EatYourDay.Scalar.Id | |
} | |
type alias SignIn = | |
{ user : Maybe User | |
, token : Maybe String | |
} | |
credential : SelectionSet SignIn EatYourDay.Object.SignIn | |
credential = | |
SelectionSet.succeed SignIn | |
|> with (SignIn.user user) | |
|> with SignIn.token | |
user : SelectionSet User EatYourDay.Object.User | |
user = | |
SelectionSet.succeed User | |
|> with User.username | |
|> with User.email | |
|> with User.id | |
signInMutation : Model -> SelectionSet (Maybe SignIn) RootMutation | |
signInMutation { form } = | |
Mutation.signIn { input = { signInParam = form.email, password = form.password }} credential |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment