1.1.0 • Published 6 years ago
@thiscover/discover v1.1.0
Discover
  npm install @thiscover/discover
  npm install @thiscover/discover-sql-sourceDescribe Your Data
type Movie @source(name: "titles", from: "imdb") {
  id: ID @field(name: "title_id")
  premiered: Int
  title: String @field(name: "primary_title")
}Attach Your Data Sources
import { discover } from "@thiscover/discover";
import { sqlite } from "@thiscover/discover-sql";
const sources: Datasources = {
  imdb: sqlite({ filename: "imdb.db" })
};
const executableSchema = discover({ schema, sources });
// ---- Your GraphQL Server Code Here --- \\Discover Your Data
query {
  lastDecade: allMovies(where: { premiered_gte: 2010 }, orderBy: title_DESC) {
    title
    premiered
  }
  avengers: aMovie(where: { title_is: "The Avengers" }) {
    title
    premiered
  }
}Features
- Keep your existing schema
 - You schema is the source of truth
 - Keep your existing data sources
 - Pull data from any and multiple data sources
 - Auto generated query API from the schema
 - Keep your existing server setup