# Trying to solve, https://github.com/parse-community/parse-server/issues/7197

**URL:** <https://community.parseplatform.org/t/trying-to-solve-https-github-com-parse-community-parse-server-issues-7197/1909>\
**Category:** GraphQL API\
**Created:** [August 18, 2021, 7:50am UTC](https://community.parseplatform.org/t/trying-to-solve-https-github-com-parse-community-parse-server-issues-7197/1909 "2021-08-18T07:50:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![axelhildingson](https://community.parseplatform.org/user_avatar/community.parseplatform.org/axelhildingson/32/761_2.png) [@axelhildingson](https://community.parseplatform.org/u/axelhildingson)\
**Post date:** [August 18, 2021, 7:50am UTC](https://community.parseplatform.org/t/trying-to-solve-https-github-com-parse-community-parse-server-issues-7197/1909/1 "2021-08-18T07:50:46Z")

</div>

Hi,

I am trying to solve this bug, [GraphQL error when retur](https://github.com/parse-community/parse-server/issues/7197).

We are in the process to migrate to gql but we still use a lot of cloud function and want to make the transition as simple as possible but this issue give us headache… I have seen that we use SchemaDirectiveVisitor to find the @resolve but it looks like we don’t use parseGraphQLSchema.addGraphQLQuery for when we add the queries, could that be the problem?

---

<div class="post-metadata">

**Author:** ![davimacedo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/davimacedo/32/316_2.png) [@davimacedo](https://community.parseplatform.org/u/davimacedo)\
**Post date:** [August 18, 2021, 6:45pm UTC](https://community.parseplatform.org/t/trying-to-solve-https-github-com-parse-community-parse-server-issues-7197/1909/2 "2021-08-18T18:45:38Z")

</div>

It looks that the array are being properly converted for the default queries but not when resolving results from cloud code functions.

---

<div class="post-metadata">

**Author:** ![axelhildingson](https://community.parseplatform.org/user_avatar/community.parseplatform.org/axelhildingson/32/761_2.png) [@axelhildingson](https://community.parseplatform.org/u/axelhildingson)\
**Post date:** [August 19, 2021, 6:12pm UTC](https://community.parseplatform.org/t/trying-to-solve-https-github-com-parse-community-parse-server-issues-7197/1909/3 "2021-08-19T18:12:09Z")

</div>

I found that the result of the resolvers returns the same format ( standard query result). But I can’t find where the query result is actually parsed and transformed to a gql result. For the default query. I think `defaultGraphQLTypes.loadArrayResult(this, parseClasses);` has something to do with…

I have a test written for problem,

`it(‘can resolve a custom query, that returns an array’, async () =\> {  
const schemaController = await parseServer.config.databaseController.loadSchema();

```
    await schemaController.addClassIfNotExists('SuperCar', {
      engine: { type: 'String' },
      doors: { type: 'Number' },
      price: { type: 'String' },
      mileage: { type: 'Number' },
      gears: { type: 'Array' }
    });

    await new Parse.Object('SuperCar').save({
      engine: 'petrol',
      doors: 3,
      price: '£7500',
      mileage: 0,
      gears: ['1', '2', '3', '4']
    });

    await new Parse.Object('SuperCar').save({
      engine: 'petrol',
      doors: 3,
      price: '£7500',
      mileage: 10000,
      gears: ['1', '2', '3', '4', '5']
    });

    await Promise.all([
      parseGraphQLServer.parseGraphQLController.cacheController.graphQL.clear(),
      parseGraphQLServer.parseGraphQLSchema.schemaCache.clear(),
    ]);

    Parse.Cloud.define('arrayOfSuperCar', async () => {
      const superCars = await new Parse.Query('SuperCar').find({useMasterKey: true})
      return superCars
    });
    const result = await apolloClient.query({
      query: gql`
      query FindSuperCar {
        arrayOfSuperCar {
          objectId
          objectId
          gears {
            ... on Element {
              value
            }
          }
        }
      }
    `,
    })
    expect(result.data.superCars.gears[2].value).toEqual('3');
  });`
```

---

<div class="post-metadata">

**Author:** ![davimacedo](https://community.parseplatform.org/user_avatar/community.parseplatform.org/davimacedo/32/316_2.png) [@davimacedo](https://community.parseplatform.org/u/davimacedo)\
**Post date:** [August 19, 2021, 7:22pm UTC](https://community.parseplatform.org/t/trying-to-solve-https-github-com-parse-community-parse-server-issues-7197/1909/4 "2021-08-19T19:22:14Z")

</div>

Would you be interested in opening a PR with this failing test case and helping us to solve this issue?

---

<div class="post-metadata">

**Author:** ![axelhildingson](https://community.parseplatform.org/user_avatar/community.parseplatform.org/axelhildingson/32/761_2.png) [@axelhildingson](https://community.parseplatform.org/u/axelhildingson)\
**Post date:** [August 21, 2021, 8:06am UTC](https://community.parseplatform.org/t/trying-to-solve-https-github-com-parse-community-parse-server-issues-7197/1909/5 "2021-08-21T08:06:19Z")

</div>

I created a PR for which includes the test, [inital test that shows the bug by axelhildingson · Pull Request #7506 · parse-community/parse-server · GitHub\</titl](https://github.com/parse-community/parse-server/pull/7506)
