JSON schema not working on insert/update in graphQL

I have a schema for a collection:

    {
      "required": [
        "name"
      ],
      "properties": {
        "_id": {
          "bsonType": "objectId"
        },
        "name": {
          "bsonType": "string",
          "minLength": 5
        }
      },
      "title": "common.location"
    }

When I run the validation on existing data, it works. When I insert data without a name, it gives me a validation error back. When I insert data with less than 5 characters, it still inserts. Does the schema do anything on insert or update? Especially from either mongodb or graphql?

So, I found out there are 2 different sections to add schema validations.

  1. One in the database (dont forget to give admin privledges)
  2. Two, the schema in the Realm App

The first one does simple validations like min/max length, nullables, etc. Kinda like database constraints in SQL land. You have to log into mongo compass to set these.

The second one is for more business rules, like make sure this record is unique based on certain criteria. More info found here: https://docs.mongodb.com/realm/mongodb/enforce-a-document-schema/