0.1.2 • Published 4 years ago
graphile-gen-js v0.1.2
graphile-gen-js
Generate JS files for mutations/queries for your Graphile GraphQL projects
npm install graphile-gen-js
import { pg as gen } from 'graphile-gen-js';
gen.crudify(introspection);
will produce
export const updateProductMutation = gql`
mutation updateProductMutation($id: UUID!, $ownerId: UUID, $name: String, $rhinoFoot: String, $hiddenFoot: String, $lizardFeet: String) {
updateProduct(input: {id: $id, patch: {ownerId: $ownerId, name: $name, rhinoFoot: $rhinoFoot, hiddenFoot: $hiddenFoot, lizardFeet: $lizardFeet}}) {
product {
id
ownerId
name
rhinoFoot
hiddenFoot
lizardFeet
}
}
}`;