import { stitchSchemas, ValidationLevel } from '@graphql-tools/stitch'
import actionLogTodoSchema from './subschemas/actionLogTodo'
import emailReceiptsSchema from './subschemas/emailDrafts'
import readReceiptsSchema from './subschemas/readReceipts'
import reloadSchema from './subschemas/reloadData'
import constructRemoteSchema from './subschemas/remoteSchema'
import subscribedTeamsSchema from './subschemas/subscribedTeams'

export const schema = stitchSchemas({
  subschemas: [
    constructRemoteSchema(),
    actionLogTodoSchema,
    readReceiptsSchema,
    emailReceiptsSchema,
    reloadSchema,
    subscribedTeamsSchema,
  ],
  typeDefs: [],
  typeMergingOptions: {
    validationSettings: {
      validationLevel: ValidationLevel.Error,
    },
  },
})
