# Error : no graphql provider present, this is most likely because no schema is present. Import a schema first!

**URL:** <https://forum.weaviate.io/t/error-no-graphql-provider-present-this-is-most-likely-because-no-schema-is-present-import-a-schema-first/1402>\
**Category:** Support\
**Created:** [February 6, 2024, 3:57pm UTC](https://forum.weaviate.io/t/error-no-graphql-provider-present-this-is-most-likely-because-no-schema-is-present-import-a-schema-first/1402 "2024-02-06T15:57:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![birgitbartels](https://avatars.discourse-cdn.com/v4/letter/b/3d9bf3/32.png) [@birgitbartels](https://forum.weaviate.io/u/birgitbartels)\
**Post date:** [February 6, 2024, 3:57pm UTC](https://forum.weaviate.io/t/error-no-graphql-provider-present-this-is-most-likely-because-no-schema-is-present-import-a-schema-first/1402/1 "2024-02-06T15:57:47Z")

</div>

Hello everyone!

After having recreated my Weaviate class instance with two extra properties, I suddenly get the error the following exception when trying to retrieve data from that class:

```auto
UnexpectedStatusCodeException: Query was not successful! Unexpected status code: 422, with response body: {'error': [{'message': 'no graphql provider present, this is most likely because no schema is present. Import a schema first!'}]}.

```

I never had this exception before and am not sure what I might have done wrong.

This is the function I use to create classes :

```
# CREATE CLASS
def create_class(self, 
    class_name: str,
    class_description: str,
    vectorizer: str = "text2vec-openai"
):
    # Create list of properties
    class_obj = {
        "class": class_name,
        "description": class_description,
        "properties": [
            {
                "dataType": ["text"],
                "indexSearchable": True,
                "description": "Title of the document.",
                "name": "title",
                "tokenization": "word"
            },
            {
                "dataType": ["text"],
                "indexSearchable": True,
                "description": "The text itself",
                "name": "body",
                "tokenization": "word"                 
            },
            {
                "dataType": ["int"],
                "description": "Page number / time stamp fragment",
                "name": "referenceLocation",
            },
            {
                "dataType": ["text"],
                "description": "Unit of the page number/timestamp",
                "name": "unit",
            },
            {
                "dataType": ["text"],
                "indexSearchable": True,
                "description": "Type of document.",
                "name": "documentType",
                "tokenization": "word"                 
            },
            {
                "dataType": ["text"],
                "indexSearchable": True,
                "description": "Type of document.",
                "name": "url",
                "tokenization": "word"                 
            },

        ]
    }

    class_obj["vectorizer"] = vectorizer
    self.client.schema.create_class(class_obj)

    return {"Status": f"The collection {class_name} has been created."}

```

Data has been added by parsing PDFs.

Now when I check if the class exists, that still works, it correctly returns True, and I can also check the schema of the class, which returns this :

```auto
{
  "class": "Geschiedenis",
  "description": "Leermaterial ASO1 voor het vak Geschiedenis",
  "invertedIndexConfig": {
    "bm25": {
      "b": 0.75,
      "k1": 1.2
    },
    "cleanupIntervalSeconds": 60,
    "stopwords": {
      "additions": null,
      "preset": "en",
      "removals": null
    }
  },
  "moduleConfig": {
    "text2vec-openai": {
      "baseURL": "https://api.openai.com",
      "model": "ada",
      "modelVersion": "002",
      "type": "text",
      "vectorizeClassName": true
    }
  },
  "multiTenancyConfig": {
    "enabled": false
  },
  "properties": [
    {
      "dataType": [
        "text"
      ],
      "description": "Title of the document.",
      "indexFilterable": true,
      "indexSearchable": true,
      "moduleConfig": {
        "text2vec-openai": {
          "skip": false,
          "vectorizePropertyName": false
        }
      },
      "name": "title",
      "tokenization": "word"
    },
    {
      "dataType": [
        "text"
      ],
      "description": "The text itself",
      "indexFilterable": true,
      "indexSearchable": true,
      "moduleConfig": {
        "text2vec-openai": {
          "skip": false,
          "vectorizePropertyName": false
        }
      },
      "name": "body",
      "tokenization": "word"
    },
    {
      "dataType": [
        "int"
      ],
      "description": "Page number / time stamp fragment",
      "indexFilterable": true,
      "indexSearchable": false,
      "moduleConfig": {
        "text2vec-openai": {
          "skip": false,
          "vectorizePropertyName": false
        }
      },
      "name": "referenceLocation"
    },
    {
      "dataType": [
        "text"
      ],
      "description": "Unit of the puge number/timestamp",
      "indexFilterable": true,
      "indexSearchable": true,
      "moduleConfig": {
        "text2vec-openai": {
          "skip": false,
          "vectorizePropertyName": false
        }
      },
      "name": "unit",
      "tokenization": "word"
    },
    {
      "dataType": [
        "text"
      ],
      "description": "Type of document.",
      "indexFilterable": true,
      "indexSearchable": true,
      "moduleConfig": {
        "text2vec-openai": {
          "skip": false,
          "vectorizePropertyName": false
        }
      },
      "name": "documentType",
      "tokenization": "word"
    },
    {
      "dataType": [
        "text"
      ],
      "description": "Type of document.",
      "indexFilterable": true,
      "indexSearchable": true,
      "moduleConfig": {
        "text2vec-openai": {
          "skip": false,
          "vectorizePropertyName": false
        }
      },
      "name": "url",
      "tokenization": "word"
    }
  ],
  "replicationConfig": {
    "factor": 1
  },
  "shardingConfig": {
    "virtualPerPhysical": 128,
    "desiredCount": 1,
    "actualCount": 1,
    "desiredVirtualCount": 128,
    "actualVirtualCount": 128,
    "key": "_id",
    "strategy": "hash",
    "function": "murmur3"
  },
  "vectorIndexConfig": {
    "skip": false,
    "cleanupIntervalSeconds": 300,
    "maxConnections": 64,
    "efConstruction": 128,
    "ef": -1,
    "dynamicEfMin": 100,
    "dynamicEfMax": 500,
    "dynamicEfFactor": 8,
    "vectorCacheMaxObjects": 1000000000000,
    "flatSearchCutoff": 40000,
    "distance": "cosine",
    "pq": {
      "enabled": false,
      "bitCompression": false,
      "segments": 0,
      "centroids": 256,
      "trainingLimit": 100000,
      "encoder": {
        "type": "kmeans",
        "distribution": "log-normal"
      }
    }
  },
  "vectorIndexType": "hnsw",
  "vectorizer": "text2vec-openai"
}

```

However, when I try to run a query on my data or retrieve data, e.g. like the following :

```auto
    def get_data(self, 
        class_name: str, 
        batch_size: int = None, 
        return_prop: List[str] = ['title', 'body', 'referenceLocation', 'unit', 'url', 'documentType'], 
        cursor: UUID = None
    ) -> dict:
        query = (
            self.client.query.get(
                class_name=class_name,
                properties=return_prop
            )
            .with_additional(["id"])
            .with_limit(batch_size)
        )

        # fetch next set of results
        if cursor is not None:
            result = query.with_after(cursor).do()
        else:
            result = query.do()
        
        return result["data"]["Get"][class_name]

```

I get this error :

```auto
UnexpectedStatusCodeException: Query was not successful! Unexpected status code: 422, with response body: {'error': [{'message': 'no graphql provider present, this is most likely because no schema is present. Import a schema first!'}]}.

```

Does anyone maybe know what is causing this error? As you could see, I did import a schema and I can retrieve it, but when retrieving data, it says that there is no schema present.

Thanks a lot!

Birgit

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [February 6, 2024, 5:37pm UTC](https://forum.weaviate.io/t/error-no-graphql-provider-present-this-is-most-likely-because-no-schema-is-present-import-a-schema-first/1402/2 "2024-02-06T17:37:32Z")

</div>

Hi @birgitbartels ! Welcome to our community 🤗

This usually happens when there is not even one class in your cluster.

Can you please run the following, considering you are using python client v3:

```auto
client.schema.get()

```

This will get you all the schemas present on that cluster.

Thanks!

---

<div class="post-metadata">

**Author:** ![birgitbartels](https://avatars.discourse-cdn.com/v4/letter/b/3d9bf3/32.png) [@birgitbartels](https://forum.weaviate.io/u/birgitbartels)\
**Post date:** [February 6, 2024, 7:29pm UTC](https://forum.weaviate.io/t/error-no-graphql-provider-present-this-is-most-likely-because-no-schema-is-present-import-a-schema-first/1402/3 "2024-02-06T19:29:21Z")

</div>

Dear @DudaNogueira ,

Thank you for your answer!

When I run the following code, as when I do the same but specifying the class name, the schema is returned, so that still works like before. I also verified the schemas of course, all 11 classes I had made are inside and they contain all the properties I specified in my class object. Importing data also seems to work like before, it is only when I try to retrieve data that the error persists.

Are there other things that activate the 422 response code?

Kind regards,

Birgit

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [February 12, 2024, 10:25pm UTC](https://forum.weaviate.io/t/error-no-graphql-provider-present-this-is-most-likely-because-no-schema-is-present-import-a-schema-first/1402/4 "2024-02-12T22:25:15Z")

</div>

Hi!

What are the version you are running?

Can you migrate this data to a new cluster, and reproduce this?

When you call, outside your app,

```auto
client.schema.get("NameOfClass")

```

do you get the same error?

Thanks!

---

<div class="post-metadata">

**Author:** ![birgitbartels](https://avatars.discourse-cdn.com/v4/letter/b/3d9bf3/32.png) [@birgitbartels](https://forum.weaviate.io/u/birgitbartels)\
**Post date:** [February 13, 2024, 5:34am UTC](https://forum.weaviate.io/t/error-no-graphql-provider-present-this-is-most-likely-because-no-schema-is-present-import-a-schema-first/1402/5 "2024-02-13T05:34:03Z")

</div>

Hu @DudaNogueira

Thank you for your answer.

I recently just deleted everything and ran my code again to create everything from scratch, and now it works again.

So I don’t know what exactly went wrong, but I am happy to say that a full restart did the trick.

Kind regards,

Birgit Bartels
