Created
November 14, 2019 05:46
-
-
Save trevorblades/47c8754e830087e97da3f25b20151860 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
import {Trick} from '../db'; | |
import {gql} from 'apollo-server'; | |
export const typeDef = gql` | |
type Attempt { | |
id: ID | |
successful: Boolean | |
offense: Boolean | |
redos: Int | |
skaterId: String | |
trick: Trick | |
} | |
`; | |
export const resolvers = { | |
Query: { | |
tricks() { | |
return Trick.findAll(); | |
}, | |
trick(parent, args) { | |
return Trick.findByPk(args.id); | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment