0.3.12 • Published 4 years ago
graphile-gen v0.3.12
graphile-gen
Generate the GraphQL mutations/queries for your PostGraphile projects
- assumes using simple inflection
npm install graphile-gen
introspecting via GraphQL
import {
generate
} from 'graphile-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
}
}
}
0.3.12
4 years ago
0.3.11
4 years ago
0.3.10
4 years ago
0.3.9
4 years ago
0.3.8
4 years ago
0.3.7
5 years ago
0.3.6
5 years ago
0.3.5
5 years ago
0.3.4
5 years ago
0.3.3
5 years ago
0.3.2
5 years ago
0.3.1
5 years ago
0.3.0
5 years ago
0.2.1
5 years ago
0.1.2
5 years ago
0.1.0
5 years ago
0.1.1
5 years ago
0.0.10
5 years ago
0.0.9
5 years ago
0.0.8
5 years ago
0.0.7
5 years ago
0.0.6
5 years ago
0.0.5
5 years ago
0.0.4
5 years ago
0.0.2
5 years ago