{"size": 1038, "ext": "js", "max_stars_repo_path": "src/v2/schema/user-search.js", "max_stars_repo_name": "mqhackett/search-api", "max_stars_repo_stars_event_min_datetime": "2022-01-18T18:58:13.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-18T18:58:13.000Z", "max_issues_repo_path": "src/v2/schema/user-search.js", "max_issues_repo_name": "mqhackett/search-api", "max_issues_repo_issues_event_min_datetime": "2021-03-18T20:33:10.000Z", "max_issues_repo_issues_event_max_datetime": "2021-11-23T21:03:29.000Z", "max_forks_repo_path": "src/v2/schema/user-search.js", "max_forks_repo_name": "mqhackett/search-api", "max_forks_repo_forks_event_min_datetime": "2021-03-29T20:59:02.000Z", "max_forks_repo_forks_event_max_datetime": "2021-09-17T17:57:37.000Z"}
{"max_stars_count": 1, "max_issues_count": 72, "max_forks_count": 6, "avg_line_length": 33.4838709677, "max_line_length": 99, "alphanum_fraction": 0.5741811175}
/** *****************************************************************************
 * Licensed Materials - Property of IBM
 * (c) Copyright IBM Corporation 2018. All Rights Reserved.
 *
 * Note to U.S. Government Users Restricted Rights:
 * Use, duplication or disclosure restricted by GSA ADP Schedule
 * Contract with IBM Corp.
 * Copyright (c) 2020 Red Hat, Inc.
 ****************************************************************************** */
// Copyright Contributors to the Open Cluster Management project
import { gql } from 'apollo-server-express';

export const typeDef = gql`
type userSearch {
  id: String
  name: String
  description: String
  searchText: String
}
`;

export const resolver = {
  Query: {
    savedSearches: (parent, args, { queryModel, req }) => queryModel.getSearches({ ...args, req }),
  },
  Mutation: {
    saveSearch: (root, args, { queryModel, req }) => queryModel.saveSearch({ ...args, req }),
    deleteSearch: (root, args, { queryModel, req }) => queryModel.deleteSearch({ ...args, req }),
  },
};
