# graphql-ast-types-browser

> :warning: This package is a temporary clone of [`graphql-ast-types`](https://www.npmjs.com/package/graphql-ast-types). It will be deleted as soon as the issue [#7](https://github.com/imranolas/graphql-ast-types/issues/7) is closed.

Latest version **1.0.2** (published 2018-10-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install graphql-ast-types-browser
pnpm add graphql-ast-types-browser
yarn add graphql-ast-types-browser
bun add graphql-ast-types-browser
```

## 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.2 |
| Published | 2018-10-30 |
| First published | 2018-10-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 163.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | kmaschta |
| Keywords | graphql, ast, types, graphql-ast-types |

## Links

- npm: https://www.npmjs.com/package/graphql-ast-types-browser
- Repository: https://github.com/Kmaschta/graphql-ast-types
- Homepage: https://github.com/Kmaschta/graphql-ast-types#readme
- Issues: https://github.com/imranolas/graphql-ast-types/issues
- npm.io page: https://npm.io/package/graphql-ast-types-browser

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2018-10-30

## README

:warning: This package is a temporary clone of [`graphql-ast-types`](https://www.npmjs.com/package/graphql-ast-types).
It will be deleted as soon as the issue [#7](https://github.com/imranolas/graphql-ast-types/issues/7) is closed.

Use it at your own risk.


<h1 align="center">graphql-ast-types</h1>
<p align="center">Autogenerated helper functions for generating a GraphQL AST</p>


This project generates helpers functions from the graphql/language AST flow descriptions. It is intended to help with building a valid GraphQL AST.

## Getting Started

`yarn add graphql-ast-types`

```js
import * as t from 'graphql-ast-types';
```

_The implementation here mimics that of `babel-types`. Thanks Babel team._

## Usage

The following is an example of how to build a simple query with AST types.

```js
import * as t from 'graphql-ast-types';
import { print } from 'graphql/language';

const ast = t.document([
  t.operationDefinition(
    'query',
    t.selectionSet([
      t.field(t.name('foo')),
      t.field(t.name('bar'))
    ])
  )
]);

print(ast);

/*
query {
  foo
  bar
}
*/
```

In addition, method calls are validated for correctness and accompanied by `is` and `assert` helpers.

```js
t.isName(t.name('Hello')); // true

t.isName({ kind: 'Name' }); // true
t.assert({ kind: 'Name' }); // no error

t.isName({ kind: 'IntValue' }); // false
t.assert({ kind: 'IntValue' }); // error
```

The full API can be found [here](https://github.com/imranolas/graphql-ast-types/blob/master/api.md).

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