launchql-gen

0.3.18 • Public • Published

launchql-gen

Generate GraphQL mutations/queries

npm install launchql-gen

introspecting via GraphQL

import {
  generate
} from 'launchql-gen';
import { print } from 'graphql/language';

const gen = generate(resultOfIntrospectionQuery);
const output = Object.keys(gen).reduce((m, key) => {
  m[key] = print(gen[key].ast);
  return m;
}, {});

console.log(output);

output

which will output the entire API as an object with the mutations and queries as values

{
  "createApiTokenMutation": "mutation createApiTokenMutation($id: UUID, $userId: UUID!, $accessToken: String, $accessTokenExpiresAt: Datetime) {
  createApiToken(input: {apiToken: {id: $id, userId: $userId, accessToken: $accessToken, accessTokenExpiresAt: $accessTokenExpiresAt}}) {
    apiToken {
      id
      userId
      accessToken
      accessTokenExpiresAt
    }
  }
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.3.181latest

Version History

VersionDownloads (Last 7 Days)Published
0.3.181
0.3.130

Package Sidebar

Install

npm i launchql-gen

Weekly Downloads

0

Version

0.3.18

License

SEE LICENSE IN LICENSE

Unpacked Size

69.1 kB

Total Files

8

Last publish

Collaborators

  • pyramation
  • phatg