# Mocking mutliple different instances of the same type

**URL:** <https://community.apollographql.com/t/mocking-mutliple-different-instances-of-the-same-type/4565>\
**Category:** Server\
**Tags:** server\
**Created:** [September 21, 2022, 4:36pm UTC](https://community.apollographql.com/t/mocking-mutliple-different-instances-of-the-same-type/4565 "2022-09-21T16:36:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Calebm5577](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/calebm5577/32/3101_2.png) [@Calebm5577](https://community.apollographql.com/u/Calebm5577)\
**Post date:** [September 21, 2022, 4:36pm UTC](https://community.apollographql.com/t/mocking-mutliple-different-instances-of-the-same-type/4565/1 "2022-09-21T16:36:25Z")

</div>

I am trying to manually set up mock data to have different instances of the same type. For instance, the following code works:

```auto
const mocks = {

  Person: () => ({
    name: ()=> "Benny Lee",
    age: () => 29,
  }),

};

const server = new ApolloServer({ typeDefs, mocks: mocks });

```

I would like to have it essentially do the following:

```auto
const mocks = {

  Person: () => ({
    name: () => "Benny Lee",
    age: () => 29,
  }),
Person: () => ({
    name: () => "Berry Ken",
    age: () => 32,
  }),

};

```

The above code results in only the second listed person showing up twice in graphIQL. I did upload an unanswered [stack overflow post](https://stackoverflow.com/questions/73795389/how-to-have-mutliple-different-instances-of-the-same-type-in-mock-data?noredirect=1#comment130307883_73795389) with a few more code samples that I have tried that include my schema but then I remembered this morning this forum exists and could perhaps provide better insight.

Apologize in advance but only began using Apollo yesterday and cannot seem to find the solution to this in Apollo but did see [someone achieve this](https://upmostly.com/web-development/how-to-set-up-a-graphql-server-with-node-js) in graphql-express, where he was essentially able to have his mocked data be an array of objects, but have not figured out how to do this in Apollo.
