# How to call cloud function from Parse via GraphQL

**URL:** <https://community.parseplatform.org/t/how-to-call-cloud-function-from-parse-via-graphql/3032>\
**Category:** GraphQL API\
**Created:** [November 4, 2022, 10:59am UTC](https://community.parseplatform.org/t/how-to-call-cloud-function-from-parse-via-graphql/3032 "2022-11-04T10:59:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vildnex](https://community.parseplatform.org/user_avatar/community.parseplatform.org/vildnex/32/1398_2.png) [@Vildnex](https://community.parseplatform.org/u/Vildnex)\
**Post date:** [November 4, 2022, 10:59am UTC](https://community.parseplatform.org/t/how-to-call-cloud-function-from-parse-via-graphql/3032/1 "2022-11-04T10:59:30Z")

</div>

I have the following docker-compose:

```auto
version: '3.9'

services:
  database:
    image: mongo:6.0.2
    environment:
      MONGO_INITDB_ROOT_USERNAME: admin
      MONGO_INITDB_ROOT_PASSWORD: admin
    volumes:
      - ${HOME}/_DOCKER_DATA_/database:/data/db

  server:
    restart: always
    image: parseplatform/parse-server:5.3.0
    ports:
      - 1337:1337
    environment:
      - PARSE_SERVER_APPLICATION_ID=APP_ID
      - PARSE_SERVER_APPLICATION_NAME=COOK_NAME
      - PARSE_SERVER_MASTER_KEY=MASTER_KEY
      - PARSE_SERVER_DATABASE_URI=mongodb://admin:admin@mongo/parse_server?authSource=admin
      - PARSE_SERVER_URL=http://10.0.2.2:1337/parse
      - PARSE_SERVER_MOUNT_GRAPHQL=true
      - PARSE_SERVER_CLOUD=/parse-server/cloud/main.js
    links:
      - database:mongo
    volumes:
      - ${HOME}/_DOCKER_DATA_/server:/data/server
      - ../cloud:/parse-server/cloud
  dashboard:
    image: parseplatform/parse-dashboard:5.0.0
    ports:
      - "4040:4040"
    depends_on:
      - server
    environment:
      - PARSE_DASHBOARD_APP_ID=COOK_APP
      - PARSE_DASHBOARD_MASTER_KEY=MASTER_KEY_1
      - PARSE_DASHBOARD_USER_ID=admin
      - PARSE_DASHBOARD_USER_PASSWORD=admin
      - PARSE_DASHBOARD_ALLOW_INSECURE_HTTP=true
      - PARSE_DASHBOARD_SERVER_URL=http://localhost:1337/parse
      - PARSE_DASHBOARD_GRAPHQL_SERVER_URL=http://localhost:1337/graphql
    volumes:
      - ${HOME}/_DOCKER_DATA_/dashboard:/data/dashboard

```

And also the fallowing `.graphqlconfig` in the root of my project:

```auto
{
  "name": "Untitled GraphQL Schema",
  "schemaPath": "schema.graphql",
  "extensions": {
    "endpoints": {
      "Default GraphQL Endpoint": {
        "url": "http://localhost:1337/graphql",
        "headers": {
          "X-Parse-Application-Id": "APP_ID",
          "X-Parse-Master-Key": "MASTER_KEY"
        },
        "introspect": true
      }
    }
  }
}

```

inside of my root project I have a folder called **“cloud”** which has inside a **main.js** and also a **schema.graphql**.

**Main.js:**

```auto
Parse.Cloud.define("checkGraphQLSupport", async req => {
  if (parseGraphQLServer){
    return "This App has GraphQL support.";
  } else {
    return "This App does not have GraphQL support. Wrong Parse version maybe?";
  }
});

```

**schema.graphql**

```auto
extend type Query {
    checkGraphQLSupport: String! @resolve(to: "checkGraphQLSupport")
}

```

I am trying to call from **[http://0.0.0.0:4040/apps/COOK\_APP/api\_console/graphql](http://0.0.0.0:4040/apps/COOK_APP/api_console/graphql)** the cloud function via graphql by using the following query:

```auto
query {
	checkGraphQLSupport
}

```

But this is not working and I get the fallowing error message:

> “Cannot query field "checkGraphQLSupport" on type "Query".”

Can anyone explain to me what I am doing wrong? All what I am trying to do is to call the cloud code using graphql.

---

<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:** [November 10, 2022, 7:37pm UTC](https://community.parseplatform.org/t/how-to-call-cloud-function-from-parse-via-graphql/3032/2 "2022-11-10T19:37:33Z")

</div>

Try to add the env var `PARSE_SERVER_GRAPH_QLSCHEMA=/parse-server/cloud/schema.graphql`
