sendou.ink/graphql-schemas/salmonRunRecord.ts
2020-09-09 17:37:11 +03:00

45 lines
985 B
TypeScript

const { gql } = require("apollo-server-express")
import {
salmonRunRecordWildcards,
salmonRunRecordCategories,
} from "../utils/enums"
const typeDef = gql`
extend type Mutation {
createSalmonRunRecord(input: CreateSalmonRunRecordInput!): Boolean!
}
input CreateSalmonRunRecordInput {
goldenEggCount: Int!
stage: String!
wildcards: SalmonRunRecordWildcards
category: SalmonRunRecordCategory!
rosterUserIds: [Int!]
grizzcoWeapon: String
weaponRotation: [String!]
links: [String!]
}
enum SalmonRunRecordWildcards {
${salmonRunRecordWildcards.map((wildcard) => wildcard + "\n")}
}
enum SalmonRunRecordCategory {
${salmonRunRecordCategories.map((category) => category + "\n")}
}
`
const resolvers = {
Mutation: {
createSalmonRunRecord: async (root: any, args: any) => {
console.log(args)
return true
},
},
}
module.exports = {
SalmonRunRecord: typeDef,
salmonRunRecordResolvers: resolvers,
}