@thiscover/discover

1.1.0 • Public • Published

Discover

GitHub Logo

  npm install @thiscover/discover
  npm install @thiscover/discover-sql-source

Describe 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

See it in action

Schema

Readme

Keywords

Package Sidebar

Install

npm i @thiscover/discover

Weekly Downloads

1

Version

1.1.0

License

ISC

Unpacked Size

854 kB

Total Files

86

Last publish

Collaborators

  • thiscover