# sgq

> query graphql with only a graphql idl schema

Latest version **1.0.3** (published 2017-07-11) · AGPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install sgq
pnpm add sgq
yarn add sgq
bun add sgq
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2017-07-11 |
| First published | 2017-07-10 |
| Weekly downloads | 0 |
| License | AGPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Manuel Baesler |
| Maintainers | baslr |
| Keywords | graphql, idl, schema, query |

## Links

- npm: https://www.npmjs.com/package/sgq
- Repository: https://github.com/baslr/sgq
- Homepage: https://github.com/baslr/sgq#readme
- Issues: https://github.com/baslr/sgq/issues
- npm.io page: https://npm.io/package/sgq

## Dependencies (1)

- [graphql-sync](https://npm.io/package/graphql-sync.md) 0.10.1-sync

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2017-07-11
- 1.0.2 — 2017-07-10
- 1.0.0 — 2017-07-10

## README

# sgq
schema graphql query – query GraphQL with only a GraphQL IDL schema.

Are you tired of writing GraphQL.js schema files?

Then try `sgq`. `sgq` needs only a GraphQL IDL file and generates the GraphQL.js schema automatically.



# Example


```es6
'use strict';

const graphql = require('graphql-sync').graphql;
const sgq = require('sgq');


let typeDefs = [`
  type BlogEntry {
    _key: String!
    authorKey: String!

    author: Author @aql(exec: "FOR author in Author filter author._key == @current.authorKey return author")
  }

  type Author {
    _key: String!
    name: String
  }

  type Query {
    blogEntry(_key: String!): BlogEntry
  }
`]

const schema = sgq(typeDefs);

const query = `
{
  blogEntry(_key: "1") {
    _key
    authorKey
    author {
      name
     }
  }
}`;

const result = graphql(schema, query);
print(result);
/*
{
  "data" : {
    "blogEntry" : {
      "_key" : "1",
      "authorKey" : "2",
      "author" : {
        "name" : "Plumbum"
      }
    }
  }
}
*/`
```

---
_Source: https://npm.io/package/sgq · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
