Astra.Graphql (astra v0.5.0)

Provides functions to access the public methods of the GraphQL API for databases hosted on https://astra.datastax.com.

Astra's GraphQL API is implemented using the stargate project, https://stargate.io.

If required, raw access to the Astra REST Document API can be obtained through the Astra.Graphql.Http module.

Link to this section Summary

Functions

Send queries to the graphql Schema endpoint

Send queries to the graphql Schema endpoint

Link to this section Functions

Specs

schema(String) :: {Atom, Map}

Send queries to the graphql Schema endpoint

Parameters

  • query: a valid graphql schema query
  • collection: name of the document collection
  • doc: the new document.

Examples

> query = """ 
          query GetTables {
              keyspace(name: "test") {
                name
                tables {
                  name
                  columns {
                    name
                    kind
                    type {
                      basic
                      info {
                        name
                      }
                    }
                  }
                }
              }
            }
        """
> Astra.Graphql.schema(query)
Link to this function

tables(keyspace, query)

Specs

tables(String, String) :: {Atom, Map}

Send queries to the graphql Schema endpoint

Parameters

  • query: a valid graphql schema query
  • collection: name of the document collection
  • doc: the new document.

Examples

> query = """
    query oneThing {
      thing(value: { id: "test" }) {
        values {
          id
          name
        }
      }
    }
    """
> Astra.Graphql.tables("test", query)