apollo graphql 中的 Cassandra 支持

Cassandra support in apollo graphql

我想将 Apache Cassandra 连接到 apollo graphql 服务器。是否有任何 ORM 库可用于节点中的 cassandra,就像关系数据库的 Sequelize 一样。 谁能帮帮我

也许这会有所帮助:

http://express-cassandra.readthedocs.io/en/stable/

根据页面描述:Express-Cassandra 是 Cassandra ORM/ODM/OGM 用于 NodeJS,支持 Elassandra 和 JanusGraph。

有一个为 Cassandra 自动生成的 GraphQL API,您可以 运行 作为一项服务通过 GraphQL 公开您的 CQL table。

GitHub 回购:https://github.com/datastax/cassandra-data-apis

小例子: 假设您有一个名为 books

的 table
CREATE TABLE library.books (
    title text PRIMARY KEY,
    author text
);

它会自动生成这些APIs

schema {
  query: Query
  mutation: Mutation
}

type Query {
  books(value: BooksInput, orderBy: [BooksOrder], options: QueryOptions): BooksResult
  booksFilter(filter: BooksFilterInput!, orderBy: [BooksOrder], options: QueryOptions): BooksResult
}

type Mutation {
  insertBooks(value: BooksInput!, ifNotExists: Boolean, options: UpdateOptions): BooksMutationResult
  updateBooks(value: BooksInput!, ifExists: Boolean, ifCondition: BooksFilterInput, options: UpdateOptions): BooksMutationResult
  deleteBooks(value: BooksInput!, ifExists: Boolean, ifCondition: BooksFilterInput, options: UpdateOptions): BooksMutationResult
}

您可以使用

查询它们
mutation {
  catch22: insertBooks(value: {title:"Catch-22", author:"Joseph Heller"}) {
    value {
      title
    }
  }
}

query {
    books (value: {title:"Catch-22"}) {
      values {
        title
        author
      }
    }
}