Package Exports
- launchql-gen
- launchql-gen/esm/index.js
- launchql-gen/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (launchql-gen) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
launchql-gen
Generate GraphQL mutations/queries
npm install launchql-genintrospecting 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
}
}
}