Skip to content

Instantly share code, notes, and snippets.

@trevorblades
Created November 14, 2019 05:46
Show Gist options
  • Save trevorblades/47c8754e830087e97da3f25b20151860 to your computer and use it in GitHub Desktop.
Save trevorblades/47c8754e830087e97da3f25b20151860 to your computer and use it in GitHub Desktop.
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