Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@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

Install

npm i @thiscover/discover

DownloadsWeekly Downloads

4

Version

1.1.0

License

ISC

Unpacked Size

854 kB

Total Files

86

Last publish

Collaborators

  • avatar