import { makeExecutableSchema } from '@graphql-tools/schema'
import reloadQL from '../../schemas/reloadData.graphql'
import type { SubschemaConfig } from './typing'

const reloadSchema: SubschemaConfig = {
  schema: makeExecutableSchema({
    typeDefs: [reloadQL],
    resolvers: {
      Mutation: {
        reloadTable() {
          return {
            operationDone: true,
          }
        },
        reloadExercises() {
          return {
            operationDone: true,
          }
        },
        reloadDefinitions() {
          return {
            operationDone: true,
          }
        },
      },
    },
  }),
}

export default reloadSchema
