{"size": 761, "ext": "js", "max_stars_repo_path": "src/schema/local/mocks.js", "max_stars_repo_name": "kporten/play-graphql-server-mock", "max_stars_repo_stars_event_min_datetime": "2021-02-28T20:12:47.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-09T14:11:17.000Z", "max_issues_repo_path": "src/schema/local/mocks.js", "max_issues_repo_name": "kporten/play-graphql-server-mock", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/schema/local/mocks.js", "max_forks_repo_name": "kporten/play-graphql-server-mock", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 21.1388888889, "max_line_length": 101, "alphanum_fraction": 0.6281208936}
import { MockList, gql } from 'apollo-server';
import casual from 'casual';

import './generators.js';

// TODO add your type definitions (https://www.apollographql.com/docs/apollo-server/testing/mocking/)
export const typeDefs = gql`
  scalar DateTime

  type Query {
    hello: String
    user(id: ID!): User
    users: [User]
  }

  type Mutation {
    updateUser(id: ID!): User
  }

  type User {
    id: ID!
    name: String!
    age: Int!
    createdAt: DateTime!
  }
`;

// TODO add your mocks (https://www.apollographql.com/docs/apollo-server/testing/mocking/)
export const mocks = {
  DateTime: () => casual.date('YYYY-MM-DDTHH:mm:ssZ'),
  Query: () => ({
    users: () => new MockList([1, 3]),
  }),
  User: (parent, args) => casual.user(args.id),
};
