Inspect Versions

You can see all the changes that you have made in a schema version by using getConfigurationVersion query. The result will give you details of all the edits made in a specific version such as paginated views of the enums, the objects and the corresponding fields and relationships added or updated in them. You can request to see every change or specific ones.

If the schema version does not exist, a NotFound exception will be returned in the error response.

View All Configuration Changes Per Version

Below is an example query to view all the configuration changes made in schema version 3.

query InspectVersion {
  getConfigurationVersion(version: 3) {
    active
    version
    enums {
      objects {
        name
        values
      }
      count
      next_token
    }
    configured_objects {
      objects {
        name
        operation
        fields {
          objects {
            type
            required
            operation
            name
            is_translatable
            enum_name
          }
          count
        }
        relationships {
          objects {
            from_class
            operation
            relationship_name
            reverse_relationship_name
            to_class
          }
          count
          next_token
        }
      }
      count
      next_token
    }
  }
}

Example response:

{
  "data": {
    "getConfigurationVersion": {
      "active": false,
      "version": 3,
      "enums": {
        "objects": [
          {
            "name": "EpisodeType",
            "values": [
              "NORMAL",
              "INTERACTIVE"
            ]
          }
        ],
        "count": 1,
        "next_token": null
      },
      "configured_objects": {
        "objects": [
          {
            "name": "Episode",
            "operation": "UPDATE",
            "fields": {
              "objects": [
                {
                  "type": "STRING",
                  "required": true,
                  "operation": "CREATE",
                  "name": "additional_name",
                  "is_translatable": true,
                  "enum_name": null
                },
                {
                  "type": "ENUM",
                  "required": false,
                  "operation": "CREATE",
                  "name": "episode_type",
                  "is_translatable": false,
                  "enum_name": "Episodetype"
                },
                {
                  "type": "STRING",
                  "required": true,
                  "operation": "CREATE",
                  "name": "test_field1",
                  "is_translatable": false,
                  "enum_name": null
                },
                {
                  "type": "STRING",
                  "required": true,
                  "operation": "CREATE",
                  "name": "test_field3",
                  "is_translatable": true,
                  "enum_name": null
                }
              ],
              "count": 4
            },
            "relationships": {
              "objects": [
                {
                  "from_class": "Episode",
                  "operation": "CREATE",
                  "relationship_name": "movies",
                  "reverse_relationship_name": "episodes",
                  "to_class": "Movie"
                }
              ],
              "count": 1,
              "next_token": null
            }
          },
          {
            "name": "Movie",
            "operation": null,
            "fields": {
              "objects": [],
              "count": 0
            },
            "relationships": {
              "objects": [
                {
                  "from_class": "Movie",
                  "operation": "CREATE",
                  "relationship_name": "episodes",
                  "reverse_relationship_name": "movies",
                  "to_class": "Episode"
                },
                {
                  "from_class": "Movie",
                  "operation": "CREATE",
                  "relationship_name": "seasons",
                  "reverse_relationship_name": "movies",
                  "to_class": "Season"
                }
              ],
              "count": 2,
              "next_token": null
            }
          },
          {
            "name": "Season",
            "operation": null,
            "fields": {
              "objects": [],
              "count": 0
            },
            "relationships": {
              "objects": [
                {
                  "from_class": "Season",
                  "operation": "CREATE",
                  "relationship_name": "movies",
                  "reverse_relationship_name": "seasons",
                  "to_class": "Movie"
                }
              ],
              "count": 1,
              "next_token": null
            }
          }
        ],
        "count": 3,
        "next_token": null
      }
    }
  }
}

Details For Specific Enum Per Version

You can get the details of a specific enum created in a schema version by using the input argument enum_name. Below is a sample query to retrieve enum EpisodeType created in version 3. If no such enum is present, it will return an empty object list.

query EnumVersion {
  getConfigurationVersion(version: 3) {
    enums(enum_name: "EpisodeType") {
      objects {
        name
        values
      }
    }
  }
}

Sample response:

{
  "data": {
    "getConfigurationVersion": {
      "enums": {
        "objects": [
          {
            "name": "EpisodeType",
            "values": [
              "NORMAL",
              "INTERACTIVE"
            ]
          }
        ]
      }
    }
  }
}

Details For Specific Object Per Version

To see the details of an object edited in a schema version, the input argument object_name can be used. Here is a sample query to see all the edits made on Episode objects in version 3

query ObjectVersion {
  getConfigurationVersion(version: 3) {
    configured_objects(object_name: "Episode") {
      objects {
        name
        operation
        fields {
          objects {
            type
            required
            operation
            name
            is_translatable
            enum_name
          }
        }
        relationships {
          objects {
            from_class
            operation
            relationship_name
            reverse_relationship_name
            to_class
          }
        }
        operation
      }
    }
  }
}

Sample response:

{
  "data": {
    "getConfigurationVersion": {
      "configured_objects": {
        "objects": [
          {
            "name": "Episode",
            "operation": "UPDATE",
            "fields": {
              "objects": [
                {
                  "type": "STRING",
                  "required": true,
                  "operation": "CREATE",
                  "name": "additional_name",
                  "is_translatable": true,
                  "enum_name": null
                },
                {
                  "type": "ENUM",
                  "required": false,
                  "operation": "CREATE",
                  "name": "episode_type",
                  "is_translatable": false,
                  "enum_name": "EpisodeType"
                },
                {
                  "type": "STRING",
                  "required": true,
                  "operation": "CREATE",
                  "name": "test_field1",
                  "is_translatable": false,
                  "enum_name": null
                }
              ]
            },
            "relationships": {
              "objects": [
                {
                  "from_class": "Episode",
                  "operation": "CREATE",
                  "relationship_name": "movies",
                  "reverse_relationship_name": "episodes",
                  "to_class": "Movie"
                }
              ]
            }
          }
        ]
      }
    }
  }
}

Details For Specific Field Per Version

To get details of a specific field added or removed from an object, the input arguments object_name and field_name can be set in the query. If the field has not been editted, an empty object list will be returned in fields. Here is an example to get the details of the field additional_name added in Episode object in schema version 3.

query FieldVersion {
  getConfiguraVersion(version: 3) {
    configured_objects(object_name: "Episode") {
      objects {
        name
        fields(field_name: "additional_title") {
          objects {
            type
            required
            operation
            name
            is_translatable
            enum_name
          }
        }
      }
    }
  }
}

Sample response:

{
  "data": {
    "getConfigurationVersion": {
      "configured_objects": {
        "objects": [
          {
            "name": "Episode",
            "fields": {
              "objects": [
                {
                  "type": "STRING",
                  "required": true,
                  "operation": "CREATE",
                  "name": "additional_title",
                  "is_translatable": true,
                  "enum_name": null
                }
              ]
            }
          }
        ]
      }
    }
  }
}

Details For Specific Relationship Per Version

To get details of a specific relationship added or removed from an object, the input arguments object_name and relationship_name can be set in the query. If the relationship is not present among the edits, an empty object list will be returned in relationships. Here is an example to get the details of the relationship called movies added from Episode to Movie object in schema version 3.

query RelationshipVersion {
  getConfigurationVersion(version: 3) {
    configured_objects(object_name: "Episode") {
      objects {
        name
        relationships(relationship_name: "movies") {
          objects {
            from_class
            operation
            relationship_name
            reverse_relationship_name
            to_class
          }
        }
      }
    }
  }
}

Sample response:

{
  "data": {
    "getConfigurationVersion": {
      "configured_objects": {
        "objects": [
          {
            "name": "Episode",
            "relationships": {
              "objects": [
                {
                  "from_class": "Episode",
                  "operation": "CREATE",
                  "relationship_name": "movies",
                  "reverse_relationship_name": "episodes",
                  "to_class": "Movie"
                }
              ]
            }
          }
        ]
      }
    }
  }
}

List Configuration Versions

You can view all the changes that you have made in all schema versions - draft or published - by using listConfigurationVersions query. The result will give you the details of all the edits made in all the versions in paginated way.

Sample request to get all details in all configuration versions

query ListVersions {
  listConfigurationVersions {
    count
    next_token
    objects {
      active
      base_version
      published
      version
      configured_objects {
        objects {
          name
          operation
          fields {
            objects {
              enum_name
              is_translatable
              name
              operation
              required
              type
            }
          }
          relationships {
            objects {
              from_class
              operation
              relationship_name
              reverse_relationship_name
              to_class
            }
          }
        }
      }
      enums {
        objects {
          name
          values
        }
      }
    }
  }
}

Response:

{
  "data": {
    "listConfigurationVersions": {
      "count": 2,
      "next_token": null,
      "objects": [
        {
          "active": false,
          "base_version": null,
          "published": true,
          "version": 1,
          "configured_objects": {
            "objects": []
          },
          "enums": {
            "objects": []
          }
        },
        {
          "active": true,
          "base_version": 1,
          "published": true,
          "version": 2,
          "configured_objects": {
            "objects": [
              {
                "name": "Episode",
                "operation": "UPDATE",
                "fields": {
                  "objects": [
                    {
                      "enum_name": null,
                      "is_translatable": true,
                      "name": "additional_title",
                      "operation": "CREATE",
                      "required": false,
                      "type": "STRING"
                    },
                    {
                      "enum_name": "EpisodeType",
                      "is_translatable": false,
                      "name": "episode_type",
                      "operation": "CREATE",
                      "required": false,
                      "type": "ENUM"
                    }
                  ]
                },
                "relationships": {
                  "objects": []
                }
              }
            ]
          },
          "enums": {
            "objects": [
              {
                "name": "EpisodeType",
                "values": [
                  "NORMAL",
                  "INTERACTIVE"
                ]
              }
            ]
          }
        }
      ]
    }
  }
}

Details For Specific Type Across All Versions

Just like getConfigurationVersion endpoint, It is possible see what changes have been made for a particular type. For example, to see what changes were made to Episode object across versions, we can query as below:

query TypeVersion {
  listConfigurationVersions {
    objects {
      active
      base_version
      published
      version
      configured_objects(object_name: "Episode") {
        objects {
          name
          operation
          fields {
            objects {
              enum_name
              is_translatable
              name
              operation
              required
              type
            }
          }
          relationships {
            objects {
              from_class
              operation
              relationship_name
              reverse_relationship_name
              to_class
            }
          }
        }
      }
    }
  }
}

Response:

{
  "data": {
    "listConfigurationVersions": {
      "objects": [
        {
          "active": false,
          "base_version": null,
          "published": true,
          "version": 1,
          "configured_objects": {
            "objects": []
          }
        },
        {
          "active": true,
          "base_version": 1,
          "published": true,
          "version": 2,
          "configured_objects": {
            "objects": [
              {
                "name": "Episode",
                "operation": "UPDATE",
                "fields": {
                  "objects": [
                    {
                      "enum_name": null,
                      "is_translatable": true,
                      "name": "additional_title",
                      "operation": "CREATE",
                      "required": false,
                      "type": "STRING"
                    },
                    {
                      "enum_name": "EpisodeType",
                      "is_translatable": false,
                      "name": "episode_type",
                      "operation": "CREATE",
                      "required": false,
                      "type": "ENUM"
                    }
                  ]
                },
                "relationships": {
                  "objects": []
                }
              }
            ]
          }
        },
        {
          "active": false,
          "base_version": 2,
          "published": false,
          "version": 3,
          "configured_objects": {
            "objects": [
              {
                "name": "Episode",
                "operation": "UPDATE",
                "fields": {
                  "objects": [
                    {
                      "enum_name": null,
                      "is_translatable": true,
                      "name": "test_field1",
                      "operation": "CREATE",
                      "required": false,
                      "type": "STRING"
                    }
                  ]
                },
                "relationships": {
                  "objects": []
                }
              }
            ]
          }
        },
        {
          "active": false,
          "base_version": 2,
          "published": false,
          "version": 4,
          "configured_objects": {
            "objects": [
              {
                "name": "Episode",
                "operation": "UPDATE",
                "fields": {
                  "objects": [
                    {
                      "enum_name": null,
                      "is_translatable": null,
                      "name": "title_long",
                      "operation": "DELETE",
                      "required": null,
                      "type": null
                    }
                  ]
                },
                "relationships": {
                  "objects": []
                }
              }
            ]
          }
        }
      ]
    }
  }
}