# expedient

> The name for this library is a synonym of scheme and was chosen because some forms of its definition are "Beneficial or being of advantage in a given circumstance" and "Having, showing, or done with good judgment or sense" or "Capable of working successfu

Latest version **0.0.1** (published 2021-07-04) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2021-07-04 |
| First published | 2021-07-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 1 |
| Unpacked size | 22.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Floffah |
| Maintainers | floffah |
| Keywords | graphql, schema, builder |

## Links

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

## Dependencies (1)

- [graphql-subscriptions](https://npm.io/package/graphql-subscriptions.md) ^1.2.1

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 0.0.1 (latest) — 2021-07-04

## README

# Expedient

The name for this library is a synonym of scheme and was chosen because some forms of its definition
are "Beneficial or being of advantage in a given circumstance" and "Having, showing, or done with
good judgment or sense" or "Capable of working successfully" which although this library may not
achieve, it tries to be a small and quick way to make functional and working graphql schemas

# Usage

`npm i expedient` or `yarn add expedient`

```ts
import {e} from "expedient";

const query = e.buildObject("Query", [
    e.buildField(
        "ping; For rount-trip calculation purposes",
        GraphQLString,
        () => "pong",
    ),
]);

const schema = e.buildSchema(query);

// do something with the schema;
```

See a full blown example in [test.ts](./src/test.ts)

I haven't written documentation for this library yet, however, if you are using typescript in a 
capable ide, you should be able to use it pretty easily. Every type has the word build before it.
E.g. for an interface `e.buildInterface()`, for a field `e.buildField()` with the only 
exceptions being for the query, mutation, and subscription objects which you should use `e.
buildObject()` for and is what `e.buildSchema()` expects.

## Info strings

You'll notice a type called InfoString is used a lot in this package, this represents a single 
string that is used as the name and description, if using typescript 4.2 or newer, it should 
warn you when this is wrong. The format goes `Name` or `Name; Description` (the space after the 
semicolon
is optional)

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