Check the keyspace schema

To check if the schema exists, execute a GraphQL check in http://localhost:8080/graphql-admin:

For all versions of a keyspace schema:

  • graphQL command

  • Result

# Works in http://localhost:8080/graphql-admin
{
  schemas(keyspace: "library") {
    version
    deployDate
    contents
  }
}
{
  "data": {
    "schemas": [
      {
        "version": "4adc2e30-9e53-11eb-8fde-b341b9f82ca9",
        "deployDate": "2021-04-16T01:30:14.035Z[Etc/UTC]",
        "contents": "type Address @cql_entity(target: UDT) @cql_input {\n      street: String\n      city: String\n      state: String\n      zipCode: String @cql_column(name: \"zip_code\")\n    }\n    type Review @cql_entity(target: UDT) @cql_input {\n      bookTitle: String @cql_column(name: \"book_title\")\n      comment: String\n      rating: Int\n      reviewDate: Date @cql_column(name: \"review_date\")\n   }\n    type Book @key @cql_entity(name: \"book\") @cql_input {\n      title: String! @cql_column(partitionKey: true)\n      author: String @cql_column(clusteringOrder: ASC)\n    }\n     type Reader @key @cql_entity(name: \"reader\") @cql_input {\n      name: String! @cql_column(partitionKey: true)\n      user_id: Uuid! @cql_column(clusteringOrder: ASC)\n      birthdate: Date\n      email: [String] @cql_column(typeHint: \"set<varchar>\")\n      reviews: [Review]\n      address: [Address]\n    }\n    type Query {\n      book(title:String!, author:String): Book\n      reader(name:String!, user_id:Uuid): Reader\n    }\n    type Mutation {\n      insertBook(book:BookInput!): Book\n      deleteUser(book:BookInput!): Boolean\n      insertReader(reader:ReaderInput!):Reader\n      deleteReader(reader:ReaderInput!):Boolean\n    }"
      },
      {
        "version": "ba500230-9e50-11eb-8fde-b341b9f82ca9",
        "deployDate": "2021-04-16T01:11:52.531Z[Etc/UTC]",
        "contents": "type Address @cql_entity(target: UDT) @cql_input {\n      street: String\n      city: String\n      state: String\n      zipCode: String @cql_column(name: \"zip_code\")\n    }\n    type Review @cql_entity(target: UDT) @cql_input {\n      bookTitle: String @cql_column(name: \"book_title\")\n      comment: String\n      rating: Int\n      reviewDate: Date @cql_column(name: \"review_date\")\n   }\n    type Book @key @cql_entity(name: \"book\") @cql_input {\n      title: String! @cql_column(partitionKey: true)\n      author: String @cql_column(clusteringOrder: ASC)\n    }\n     type Reader @cql_entity(name: \"reader\") @cql_input {\n      name: String! @cql_column(partitionKey: true)\n      user_id: Uuid! @cql_column(clusteringOrder: ASC)\n      birthdate: Date\n      email: [String] @cql_column(typeHint: \"set<varchar>\")\n      reviews: [Review]\n      address: [Address]\n    }\n    type Query {\n      book(title:String!, author:String): Book\n      reader(name:String!, user_id:Uuid): Reader\n    }\n    type Mutation {\n      insertBook(book:BookInput!): Book\n      deleteUser(book:BookInput!): Boolean\n      insertReader(reader:ReaderInput!):Reader\n      deleteReader(reader:ReaderInput!):Boolean\n    }"
      },
      {
        "version": "afc1fb70-9e50-11eb-8fde-b341b9f82ca9",
        "deployDate": "2021-04-16T01:11:34.823Z[Etc/UTC]",
        "contents": "type Address @cql_entity(target: UDT) @cql_input {\n      street: String\n      city: String\n      state: String\n      zipCode: String @cql_column(name: \"zip_code\")\n    }\n    type Review @cql_entity(target: UDT) @cql_input {\n      bookTitle: String @cql_column(name: \"book_title\")\n      comment: String\n      rating: Int\n      reviewDate: Date @cql_column(name: \"review_date\")\n   }\n    type Book @key @cql_entity(name: \"book\") @cql_input {\n      title: String! @cql_column(partitionKey: true)\n      author: String @cql_column(clusteringOrder: ASC)\n    }\n     type Reader @cql_entity(name: \"reader\") @cql_input {\n      name: String! @cql_column(partitionKey: true)\n      user_id: Uuid! @cql_column(clusteringOrder: ASC)\n      birthdate: Date\n      email: [String] @cql_column(typeHint: \"set<varchar>\")\n      reviews: [Review]\n      address: [Address]\n    }\n    type Query {\n      book(title:String!, author:String): Book\n      reader(name:String!, user_id:Uuid): Reader\n    }\n    type Mutation {\n      insertBook(book:BookInput!): Book\n      deleteUser(book:BookInput!): Boolean\n      insertReader(reader:ReaderInput!):Reader\n      deleteReader(reader:ReaderInput!):Boolean\n    }"
      },
      {
        "version": "92ab6350-9e50-11eb-8fde-b341b9f82ca9",
        "deployDate": "2021-04-16T01:10:46.021Z[Etc/UTC]",
        "contents": "type Address @cql_entity(target: UDT) @cql_input {\n      street: String\n      city: String\n      state: String\n      zipCode: String @cql_column(name: \"zip_code\")\n    }\n    type Review @cql_entity(target: UDT) @cql_input {\n      bookTitle: String @cql_column(name: \"book_title\")\n      comment: String\n      rating: Int\n      reviewDate: Date @cql_column(name: \"review_date\")\n   }\n    type Book @key @cql_entity(name: \"book\") @cql_input {\n      title: String! @cql_column(partitionKey: true)\n      author: String @cql_column(clusteringOrder: ASC)\n    }\n     type Reader @cql_entity(name: \"reader\") @cql_input {\n      name: String! @cql_column(partitionKey: true)\n      user_id: Uuid! @cql_column(clusteringOrder: ASC)\n      birthdate: Date\n      email: [String] @cql_column(typeHint: \"set<varchar>\")\n      reviews: [Review]\n      address: [Address]\n    }\n    type Query {\n      book(title:String!, author:String): Book\n    }\n    type Mutation {\n      insertBook(book:BookInput!): Book\n      deleteUser(book:BookInput!): Boolean\n      insertReader(reader:ReaderInput!):Reader\n    }"
      },
      {
        "version": "72b6d890-9e50-11eb-8fde-b341b9f82ca9",
        "deployDate": "2021-04-16T01:09:52.409Z[Etc/UTC]",
        "contents": "type Address @cql_entity(target: UDT) @cql_input {\n      street: String\n      city: String\n      state: String\n      zipCode: String @cql_column(name: \"zip_code\")\n    }\n    type Review @cql_entity(target: UDT) @cql_input {\n      bookTitle: String @cql_column(name: \"book_title\")\n      comment: String\n      rating: Int\n      reviewDate: Date @cql_column(name: \"review_date\")\n   }\n    type Book @key @cql_entity(name: \"book\") @cql_input {\n      title: String! @cql_column(partitionKey: true)\n      author: String @cql_column(clusteringOrder: ASC)\n    }\n     type Reader @cql_entity(name: \"reader\") @cql_input {\n      name: String! @cql_column(partitionKey: true)\n      user_id: Uuid! @cql_column(clusteringOrder: ASC)\n      birthdate: Date\n      email: [String] @cql_column(typeHint: \"set<varchar>\")\n      reviews: [Review]\n      address: [Address]\n    }\n    type Query {\n      book(title:String!, author:String): Book\n    }\n    type Mutation {\n      insertBook(book:BookInput!): Book\n      deleteUser(book:BookInput!): Boolean\n    }"
      },
      {
        "version": "5d6f0020-9e50-11eb-8fde-b341b9f82ca9",
        "deployDate": "2021-04-16T01:09:16.706Z[Etc/UTC]",
        "contents": "type Address @cql_entity(target: UDT) @cql_input {\n      street: String\n      city: String\n      state: String\n      zipCode: String @cql_column(name: \"zip_code\")\n    }\n    type Review @cql_entity(target: UDT) @cql_input {\n      bookTitle: String @cql_column(name: \"book_title\")\n      comment: String\n      rating: Int\n      reviewDate: Date @cql_column(name: \"review_date\")\n   }\n    type Book @key @cql_entity(name: \"book\") @cql_input {\n      title: String! @cql_column(partitionKey: true)\n      author: String @cql_column(clusteringOrder: ASC)\n    }\n    type Query {\n      book(title:String!, author:String): Book\n    }\n    type Mutation {\n      insertBook(book:BookInput!): Book\n      deleteUser(book:BookInput!): Boolean\n    }\n   type Reader @cql_entity(name: \"reader\") @cql_input {\n      name: String! @cql_column(partitionKey: true)\n      user_id: Uuid! @cql_column(clusteringOrder: ASC)\n      birthdate: Date\n      email: [String] @cql_column(typeHint: \"set<varchar>\")\n      reviews: [Review]\n      address: [Address]\n  }"
      },
      {
        "version": "3f607370-9e50-11eb-8fde-b341b9f82ca9",
        "deployDate": "2021-04-16T01:08:26.279Z[Etc/UTC]",
        "contents": "  type Book @key @cql_entity(name: \"book\") @cql_input {\n    title: String! @cql_column(partitionKey: true)\n    author: String @cql_column(clusteringOrder: ASC)\n  }\n  type Query {\n    book(title:String!, author:String): Book\n  }\n  type Mutation {\n    insertBook(book:BookInput!): Book\n    deleteUser(book:BookInput!): Boolean\n  }\n  type Address @cql_entity(target: UDT) @cql_input {\n    street: String\n    city: String\n    state: String\n    zipCode: String @cql_column(name: \"zip_code\")\n  }\n  type Review @cql_entity(target: UDT) @cql_input {\n    bookTitle: String @cql_column(name: \"book_title\")\n    comment: String\n    rating: Int\n    reviewDate: Date @cql_column(name: \"review_date\")\n }\n type Reader @cql_entity(name: \"reader\") @cql_input {\n    name: String! @cql_column(partitionKey: true)\n    user_id: Uuid! @cql_column(clusteringOrder: ASC)\n    birthdate: Date\n    email: [String] @cql_column(typeHint: \"set<varchar>\")\n    reviews: [Review]\n    address: [Address]\n}"
      },
      {
        "version": "01a00a50-9e50-11eb-8fde-b341b9f82ca9",
        "deployDate": "2021-04-16T01:06:42.677Z[Etc/UTC]",
        "contents": "  type Book @key @cql_entity(name: \"book\") @cql_input {\n    title: String! @cql_column(partitionKey: true)\n    author: String @cql_column(clusteringOrder: ASC)\n  }\n  type Query {\n    book(title:String!, author:String): Book\n  }\n  type Mutation {\n    insertBook(book:BookInput!): Book\n    deleteUser(book:BookInput!): Boolean\n  }\n  type Address @cql_entity(target: UDT) @cql_input {\n    street: String\n    city: String\n    state: String\n    zipCode: String @cql_column(name: \"zip_code\")\n  }\n  type Review @cql_entity(target: UDT) @cql_input {\n    bookTitle: String @cql_column(name: \"book_title\")\n    comment: String\n    rating: Int\n    reviewDate: Date @cql_column(name: \"review_date\")\n }\n type Reader @cql_entity(name: \"reader\") @cql_input {\n    name: String! @cql_column(partitionKey: true)\n    user_id: Uuid! @cql_column(clusteringOrder: ASC)\n    birthdate: Date\n    email: [String] @cql_column(typeHint: \"set<varchar>\")\n    reviews: [Review]\n    address: [Address]\n}"
      },
      {
        "version": "a19da400-9e4f-11eb-8fde-b341b9f82ca9",
        "deployDate": "2021-04-16T01:04:01.600Z[Etc/UTC]",
        "contents": "  type Book @key @cql_entity(name: \"book\") @cql_input {\n    title: String! @cql_column(partitionKey: true)\n    author: String @cql_column(clusteringOrder: ASC)\n  }\n  type Query {\n    book(title:String!, author:String): Book\n  }\n  type Mutation {\n    insertBook(book:BookInput!): Book\n    deleteUser(book:BookInput!): Boolean\n  }\n  type Address @cql_entity(target: UDT) @cql_input {\n    street: String\n    city: String\n    state: String\n    zipCode: String @cql_column(name: \"zip_code\")\n  }\n  type Review @cql_entity(target: UDT) @cql_input {\n    bookTitle: String @cql_column(name: \"book_title\")\n    comment: String\n    rating: Int\n    reviewDate: Date @cql_column(name: \"review_date\")\n }\n type Reader @cql_entity(name: \"reader\") @cql_input {\n    name: String! @cql_column(partitionKey: true)\n    user_id: Uuid! @cql_column(clusteringOrder: ASC)\n    birthdate: Date\n    email: [String] @cql_column(typeHint: \"set<varchar>\")\n    reviews: [Review]\n    address: [Address]\n}"
      },
      {
        "version": "290b6630-9e4f-11eb-8fde-b341b9f82ca9",
        "deployDate": "2021-04-16T01:00:39.315Z[Etc/UTC]",
        "contents": " type Book @key @cql_entity(name: \"book\") @cql_input {\n   title: String! @cql_column(partitionKey: true)\n   author: String @cql_column(clusteringOrder: ASC)\n }\n type Query {\n   book(title:String!, author:String): Book\n }\n type Mutation {\n   insertBook(book:BookInput!): Book\n   deleteUser(book:BookInput!): Boolean\n }\n type Address @cql_entity(target: UDT) {\n   street: String\n   city: String\n   state: String\n   zipCode: String @cql_column(name: \"zip_code\")\n }\n type Review @cql_entity(target: UDT) @cql_input {\n   bookTitle: String @cql_column(name: \"book_title\")\n   comment: String\n   rating: Int\n   reviewDate: Date @cql_column(name: \"review_date\")\n}"
      }
    ]
  }
}

Note that the result lists the current schema version for every loaded schema.

For a particular version of a keyspace schema:

  • graphQL command

  • Result

{
  schema(keyspace: "library", version: "01a00a50-9e50-11eb-8fde-b341b9f82ca9") {
    version
    deployDate
    contents
  }
}
{
  "data": {
    "schema": {
      "version": "01a00a50-9e50-11eb-8fde-b341b9f82ca9",
      "deployDate": "2021-04-16T01:06:42.677Z[Etc/UTC]",
      "contents": "  type Book @key @cql_entity(name: \"book\") @cql_input {\n    title: String! @cql_column(partitionKey: true)\n    author: String @cql_column(clusteringOrder: ASC)\n  }\n  type Query {\n    book(title:String!, author:String): Book\n  }\n  type Mutation {\n    insertBook(book:BookInput!): Book\n    deleteUser(book:BookInput!): Boolean\n  }\n  type Address @cql_entity(target: UDT) @cql_input {\n    street: String\n    city: String\n    state: String\n    zipCode: String @cql_column(name: \"zip_code\")\n  }\n  type Review @cql_entity(target: UDT) @cql_input {\n    bookTitle: String @cql_column(name: \"book_title\")\n    comment: String\n    rating: Int\n    reviewDate: Date @cql_column(name: \"review_date\")\n }\n type Reader @cql_entity(name: \"reader\") @cql_input {\n    name: String! @cql_column(partitionKey: true)\n    user_id: Uuid! @cql_column(clusteringOrder: ASC)\n    birthdate: Date\n    email: [String] @cql_column(typeHint: \"set<varchar>\")\n    reviews: [Review]\n    address: [Address]\n}"
    }
  }
}